From 97acd6eb2d09daee0eade07cc9cc3ea45ac2813d Mon Sep 17 00:00:00 2001 From: Christian Schoenebeck Date: Tue, 20 Dec 2016 20:09:50 +0100 Subject: [PATCH] ddns-scripts: fix return codes if provider's data already up to date Fix return codes, if ip data at Godaddy.com and Cloudflare.com are already up to date, handle it as succesful update. Signed-off-by: Christian Schoenebeck --- net/ddns-scripts/Makefile | 2 +- net/ddns-scripts/files/update_cloudflare_com_v4.sh | 8 ++++---- net/ddns-scripts/files/update_godaddy_com_v1.sh | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/net/ddns-scripts/Makefile b/net/ddns-scripts/Makefile index a9938c4ea..2056dd776 100755 --- a/net/ddns-scripts/Makefile +++ b/net/ddns-scripts/Makefile @@ -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:=6 +PKG_RELEASE:=7 PKG_LICENSE:=GPL-2.0 PKG_MAINTAINER:=Christian Schoenebeck diff --git a/net/ddns-scripts/files/update_cloudflare_com_v4.sh b/net/ddns-scripts/files/update_cloudflare_com_v4.sh index f07cd9470..d94f4c8bf 100755 --- a/net/ddns-scripts/files/update_cloudflare_com_v4.sh +++ b/net/ddns-scripts/files/update_cloudflare_com_v4.sh @@ -124,7 +124,7 @@ cloudflare_transfer || return 1 __ZONEID=$(grep -o '"id":"[^"]*' $DATFILE | grep -o '[^"]*$' | head -1) [ -z "$__ZONEID" ] && { write_log 4 "Could not detect 'zone id' for domain.tld: '$__DOMAIN'" - return 1 + return 127 } # read record id for A or AAAA record of host.domain.TLD @@ -134,7 +134,7 @@ cloudflare_transfer || return 1 __RECID=$(grep -o '"id":"[^"]*' $DATFILE | grep -o '[^"]*$' | head -1) [ -z "$__RECID" ] && { write_log 4 "Could not detect 'record id' for host.domain.tld: '$__HOST'" - return 1 + return 127 } # extract current stored IP @@ -153,12 +153,12 @@ __DATA=$(grep -o '"content":"[^"]*' $DATFILE | grep -o '[^"]*$' | head -1) expand_ipv6 $__DATA __DATA [ "$__DATA" = "$__IPV6" ] && { # IPv6 no update needed write_log 7 "IPv6 at CloudFlare.com already up to date" - return 127 + return 0 } else [ "$__DATA" = "$__IP" ] && { # IPv4 no update needed write_log 7 "IPv4 at CloudFlare.com already up to date" - return 127 + return 0 } fi } diff --git a/net/ddns-scripts/files/update_godaddy_com_v1.sh b/net/ddns-scripts/files/update_godaddy_com_v1.sh index 45fc0ccac..5fc9925f6 100755 --- a/net/ddns-scripts/files/update_godaddy_com_v1.sh +++ b/net/ddns-scripts/files/update_godaddy_com_v1.sh @@ -136,12 +136,12 @@ __DATA=$(sed -r 's/.+data":"(.+)","t.+/\1/g' $DATFILE) expand_ipv6 $__DATA __DATA [ "$__DATA" = "$__IPV6" ] && { # IPv6 no update needed write_log 7 "IPv6 at GoDaddy.com already up to date" - return 127 + return 0 } else [ "$__DATA" = "$__IP" ] && { # IPv4 no update needed write_log 7 "IPv4 at GoDaddy.com already up to date" - return 127 + return 0 } fi }