From 99264f2527802395ff1f5c2fed00919b6b05ea25 Mon Sep 17 00:00:00 2001 From: Christian Schoenebeck Date: Mon, 22 Sep 2014 16:32:56 +0200 Subject: [PATCH 1/2] ddns-scripts: fix issue (#337) current/registered ip never match new extraction of IP inside function get_registered_ip for host and nslookup thanks to jow for the sed Signed-off-by: Christian Schoenebeck --- net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh index 057fe9258..e643c7559 100644 --- a/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh +++ b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh @@ -672,7 +672,7 @@ get_registered_ip() { } || { # we need to run twice because multi-line output needs to be directly piped to grep because # pipe returns return code of last prog in pipe but we need errors from host command - __IP=$(eval $__RUNPROG | grep "^$domain" | grep -m 1 -o "$__REGEX") + __IP=$(eval $__RUNPROG | awk -F "address " '/has/ {print $2; exit}' ) } elif [ -x /usr/bin/nslookup ]; then # last use BusyBox nslookup @@ -692,7 +692,7 @@ get_registered_ip() { } || { # we need to run twice because multi-line output needs to be directly piped to grep because # pipe returns return code of last prog in pipe but we need errors from nslookup command - __IP=$(eval $__RUNPROG | sed '1,2d' | grep -o "Name:\|Address.*" | grep -m 1 -o "$__REGEX") + __IP=$(eval $__RUNPROG | sed -ne "3,\$ { s/^Address [0-9]*: \($__REGEX\).*$/\\1/p }" ) } else # there must be an error From 6522ff5e31057857ef445da785f7fedfefd01093 Mon Sep 17 00:00:00 2001 From: Christian Schoenebeck Date: Mon, 22 Sep 2014 16:34:20 +0200 Subject: [PATCH 2/2] ddns-scripts: fix issue (#337) current/registered ip never match Increase PKG_RELEASE to reflect changes Signed-off-by: Christian Schoenebeck --- net/ddns-scripts/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ddns-scripts/Makefile b/net/ddns-scripts/Makefile index 7fcb2cc80..6e69cac44 100644 --- a/net/ddns-scripts/Makefile +++ b/net/ddns-scripts/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ddns-scripts PKG_VERSION:=2.0.1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_LICENSE:=GPL-2.0 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)