6in4: replace sed match with variable substitution, change pattern from a-z to a...
authorJo-Philipp Wich <jow@openwrt.org>
Sat, 4 Sep 2010 16:09:49 +0000 (16:09 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sat, 4 Sep 2010 16:09:49 +0000 (16:09 +0000)
SVN-Revision: 22893

package/6in4/Makefile
package/6in4/files/6in4.hotplug

index c56b9c57ce37953fe24c5ca8a7d9f985c391f73d..b9fa220df7940845327e2c1731e5bf6ecf1051d7 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=6in4
 PKG_VERSION:=5
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 include $(INCLUDE_DIR)/package.mk
 
index b695b527ed018816f0476e520425db6f200425dc..790edc0e1545a3b6fc78dfcd108587250a756102 100644 (file)
@@ -32,7 +32,7 @@ if [ "$ACTION" = ifup ]; then
                        config_get password "$cfg" 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%% *}"
                                }
                                uci_set_state network "$cfg" ipaddr "$wanip"