ddns-scripts: fixes for nslookup and khost
- fix ip extraction if knot host is used together with glue records - fix ip extraction from nslookup if reverse dns record has ip with dot reported at http://forum.lede-project.org/t/ddns-scripts-error/909 Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
This commit is contained in:
parent
3823ef9bc4
commit
71b50a7acc
2 changed files with 3 additions and 5 deletions
|
@ -12,7 +12,7 @@ PKG_NAME:=ddns-scripts
|
||||||
PKG_VERSION:=2.7.6
|
PKG_VERSION:=2.7.6
|
||||||
# Release == build
|
# Release == build
|
||||||
# increase on changes of services files or tld_names.dat
|
# increase on changes of services files or tld_names.dat
|
||||||
PKG_RELEASE:=10
|
PKG_RELEASE:=11
|
||||||
|
|
||||||
PKG_LICENSE:=GPL-2.0
|
PKG_LICENSE:=GPL-2.0
|
||||||
PKG_MAINTAINER:=Christian Schoenebeck <christian.schoenebeck@gmail.com>
|
PKG_MAINTAINER:=Christian Schoenebeck <christian.schoenebeck@gmail.com>
|
||||||
|
|
|
@ -1121,20 +1121,18 @@ get_registered_ip() {
|
||||||
write_log 3 "$__PROG error: '$__ERR'"
|
write_log 3 "$__PROG error: '$__ERR'"
|
||||||
write_log 7 "$(cat $ERRFILE)"
|
write_log 7 "$(cat $ERRFILE)"
|
||||||
else
|
else
|
||||||
if [ -n "$BIND_HOST" ]; then
|
if [ -n "$BIND_HOST" -o -n "$KNOT_HOST" ]; then
|
||||||
if [ $is_glue -eq 1 ]; then
|
if [ $is_glue -eq 1 ]; then
|
||||||
__DATA=$(cat $DATFILE | grep "^$lookup_host" | grep -om1 "$__REGEX" )
|
__DATA=$(cat $DATFILE | grep "^$lookup_host" | grep -om1 "$__REGEX" )
|
||||||
else
|
else
|
||||||
__DATA=$(cat $DATFILE | awk -F "address " '/has/ {print $2; exit}' )
|
__DATA=$(cat $DATFILE | awk -F "address " '/has/ {print $2; exit}' )
|
||||||
fi
|
fi
|
||||||
elif [ -n "$KNOT_HOST" ]; then
|
|
||||||
__DATA=$(cat $DATFILE | awk -F "address " '/has/ {print $2; exit}' )
|
|
||||||
elif [ -n "$DRILL" ]; then
|
elif [ -n "$DRILL" ]; then
|
||||||
__DATA=$(cat $DATFILE | awk '/^'"$lookup_host"'/ {print $5; exit}' )
|
__DATA=$(cat $DATFILE | awk '/^'"$lookup_host"'/ {print $5; exit}' )
|
||||||
elif [ -n "$HOSTIP" ]; then
|
elif [ -n "$HOSTIP" ]; then
|
||||||
__DATA=$(cat $DATFILE | grep -om1 "$__REGEX")
|
__DATA=$(cat $DATFILE | grep -om1 "$__REGEX")
|
||||||
elif [ -n "$NSLOOKUP" ]; then
|
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
|
fi
|
||||||
[ -n "$__DATA" ] && {
|
[ -n "$__DATA" ] && {
|
||||||
write_log 7 "Registered IP '$__DATA' detected"
|
write_log 7 "Registered IP '$__DATA' detected"
|
||||||
|
|
Loading…
Reference in a new issue