6in4: replace sed match with variable substitution, change pattern from a-z to a-f (hex only)
SVN-Revision: 22893
This commit is contained in:
		@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
PKG_NAME:=6in4
 | 
					PKG_NAME:=6in4
 | 
				
			||||||
PKG_VERSION:=5
 | 
					PKG_VERSION:=5
 | 
				
			||||||
PKG_RELEASE:=1
 | 
					PKG_RELEASE:=2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
include $(INCLUDE_DIR)/package.mk
 | 
					include $(INCLUDE_DIR)/package.mk
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -32,7 +32,7 @@ if [ "$ACTION" = ifup ]; then
 | 
				
			|||||||
			config_get password "$cfg" password
 | 
								config_get password "$cfg" password
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			[ -n "$tunnelid" ] && [ -n "$username" ] && [ -n "$password" ] && {
 | 
								[ -n "$tunnelid" ] && [ -n "$username" ] && [ -n "$password" ] && {
 | 
				
			||||||
				[ "${#password}" != 32 ] || [ -n "$(echo "$password" | sed 's/[a-z0-9]//g')" ] && {
 | 
									[ "${#password}" == 32 -a -z "${password//[a-f0-9]/}" ] && {
 | 
				
			||||||
					password="$(echo -n "$password" | md5sum)"; password="${password%% *}"
 | 
										password="$(echo -n "$password" | md5sum)"; password="${password%% *}"
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				uci_set_state network "$cfg" ipaddr "$wanip"
 | 
									uci_set_state network "$cfg" ipaddr "$wanip"
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user