[for-15.05] ddns-scripts: fix/update to version 2.4.3-1 1490/head
authorChristian Schoenebeck <christian.schoenebeck@gmail.com>
Sat, 27 Jun 2015 08:37:50 +0000 (10:37 +0200)
committerChristian Schoenebeck <christian.schoenebeck@gmail.com>
Sat, 27 Jun 2015 08:37:50 +0000 (10:37 +0200)
fixed sed when filtering IP address from nslookup output
because "Server:" block might have multiple address lines.
Thanks to Arjen de Korte

Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
net/ddns-scripts/Makefile [changed mode: 0644->0755]
net/ddns-scripts/files/dynamic_dns_functions.sh

old mode 100644 (file)
new mode 100755 (executable)
index ba04fb5..1ca4756
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=ddns-scripts
 # Version == major.minor.patch
 # increase on new functionality (minor) or patches (patch)
-PKG_VERSION:=2.4.2
+PKG_VERSION:=2.4.3
 # Release == build
 # increase on changes of services files or tld_names.dat
 PKG_RELEASE:=1
index 0023f88f05198c6a083e5b21641f7b1efd4eea1c..cb0db9ac3886b7d866f8c390b177fb3d19d565a7 100755 (executable)
@@ -486,8 +486,8 @@ verify_host_port() {
                        __IPV4=$(cat $DATFILE | awk -F "address " '/has address/ {print $2; exit}' )
                        __IPV6=$(cat $DATFILE | awk -F "address " '/has IPv6/ {print $2; exit}' )
                else    # use BusyBox nslookup
-                       __IPV4=$(cat $DATFILE | sed -ne "3,\$ { s/^Address[0-9 ]\{0,\}: \($IPV4_REGEX\).*$/\\1/p }")
-                       __IPV6=$(cat $DATFILE | sed -ne "3,\$ { s/^Address[0-9 ]\{0,\}: \($IPV6_REGEX\).*$/\\1/p }")
+                       __IPV4=$(cat $DATFILE | sed -ne "/^Name:/,\$ { s/^Address[0-9 ]\{0,\}: \($IPV4_REGEX\).*$/\\1/p }")
+                       __IPV6=$(cat $DATFILE | sed -ne "/^Name:/,\$ { s/^Address[0-9 ]\{0,\}: \($IPV6_REGEX\).*$/\\1/p }")
                fi
        }
 
@@ -966,7 +966,7 @@ get_registered_ip() {
                        if [ "$__PROG" = "BIND host" ]; then
                                __DATA=$(cat $DATFILE | awk -F "address " '/has/ {print $2; exit}' )
                        else
-                               __DATA=$(cat $DATFILE | sed -ne "3,\$ { s/^Address[0-9 ]\{0,\}: \($__REGEX\).*$/\\1/p }" )
+                               __DATA=$(cat $DATFILE | sed -ne "/^Name:/,\$ { s/^Address[0-9 ]\{0,\}: \($__REGEX\).*$/\\1/p }" )
                        fi
                        [ -n "$__DATA" ] && {
                                write_log 7 "Registered IP '$__DATA' detected"