mirror of
https://github.com/openwrt/packages.git
synced 2025-12-26 11:16:31 +04:00
ddns-scripts: fixes for cloudflare v4
- update_cloudflare_com_v4.sh: enclose urls in single quotes - dynamic_dns_functions.sh: force to return only one ip, if using nslookup to get registered ip Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
This commit is contained in:
@@ -1123,7 +1123,7 @@ get_registered_ip() {
|
||||
else
|
||||
if [ -n "$BIND_HOST" ]; then
|
||||
if [ $is_glue -eq 1 ]; then
|
||||
__DATA=$(cat $DATFILE | grep "^$lookup_host" | grep -m 1 -o "$__REGEX" )
|
||||
__DATA=$(cat $DATFILE | grep "^$lookup_host" | grep -om1 "$__REGEX" )
|
||||
else
|
||||
__DATA=$(cat $DATFILE | awk -F "address " '/has/ {print $2; exit}' )
|
||||
fi
|
||||
@@ -1132,9 +1132,9 @@ get_registered_ip() {
|
||||
elif [ -n "$DRILL" ]; then
|
||||
__DATA=$(cat $DATFILE | awk '/^'"$lookup_host"'/ {print $5; exit}' )
|
||||
elif [ -n "$HOSTIP" ]; then
|
||||
__DATA=$(cat $DATFILE | grep -m 1 -o "$__REGEX")
|
||||
__DATA=$(cat $DATFILE | grep -om1 "$__REGEX")
|
||||
elif [ -n "$NSLOOKUP" ]; then
|
||||
__DATA=$(cat $DATFILE | sed -ne "/^Name:/,\$ { s/^Address[0-9 ]\{0,\}: \($__REGEX\).*$/\\1/p }" )
|
||||
__DATA=$(cat $DATFILE | sed -e '1,/Name:/d' | grep -om1 "$__REGEX" )
|
||||
fi
|
||||
[ -n "$__DATA" ] && {
|
||||
write_log 7 "Registered IP '$__DATA' detected"
|
||||
|
||||
Reference in New Issue
Block a user