Merge pull request #348 from chris5560/master

ddns-scripts: fix issue (#337) current/registered ip never match
This commit is contained in:
sbyx 2014-09-22 16:46:53 +02:00
commit 742cea53d9
2 changed files with 3 additions and 3 deletions

View file

@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=ddns-scripts PKG_NAME:=ddns-scripts
PKG_VERSION:=2.0.1 PKG_VERSION:=2.0.1
PKG_RELEASE:=1 PKG_RELEASE:=2
PKG_LICENSE:=GPL-2.0 PKG_LICENSE:=GPL-2.0
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)

View file

@ -672,7 +672,7 @@ get_registered_ip() {
} || { } || {
# we need to run twice because multi-line output needs to be directly piped to grep because # 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 # 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 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 # 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 # 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 else # there must be an error