[for-15.05] ddns-scripts: backport of 2.7.6-11 3829/head
authorChristian Schoenebeck <christian.schoenebeck@gmail.com>
Thu, 12 Jan 2017 18:26:33 +0000 (19:26 +0100)
committerChristian Schoenebeck <christian.schoenebeck@gmail.com>
Thu, 12 Jan 2017 18:26:33 +0000 (19:26 +0100)
fix problem with detecting ip from nslookup

Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
net/ddns-scripts/Makefile
net/ddns-scripts/files/dynamic_dns_functions.sh

index 1c5031d3b710a27300ddb4af4eb061f0e297256e..c57c9f326f855bc64f74e46cdc070edda54eeba1 100755 (executable)
@@ -12,7 +12,7 @@ PKG_NAME:=ddns-scripts
 PKG_VERSION:=2.7.6
 # Release == build
 # increase on changes of services files or tld_names.dat
-PKG_RELEASE:=10
+PKG_RELEASE:=11
 
 PKG_LICENSE:=GPL-2.0
 PKG_MAINTAINER:=Christian Schoenebeck <christian.schoenebeck@gmail.com>
index e3fd3b01afec65ae489b36a1495c837f8707c9d5..001dfa4e634e6cb9972f2184ca82a4392ef42e70 100755 (executable)
@@ -1132,7 +1132,7 @@ get_registered_ip() {
                        elif [ -n "$HOSTIP" ]; then
                                __DATA=$(cat $DATFILE | grep -om1 "$__REGEX")
                        elif [ -n "$NSLOOKUP" ]; then
-                               __DATA=$(cat $DATFILE | sed -e '1,/Name:/d' | grep -om1 "$__REGEX" )
+                               __DATA=$(cat $DATFILE | sed -ne "/^Name:/,\$ { s/^Address[0-9 ]\{0,\}: \($__REGEX\).*$/\\1/p }" )
                        fi
                        [ -n "$__DATA" ] && {
                                write_log 7 "Registered IP '$__DATA' detected"