ddns-scripts: fix return codes if provider's data already up to date 3683/head
authorChristian Schoenebeck <christian.schoenebeck@gmail.com>
Tue, 20 Dec 2016 19:09:50 +0000 (20:09 +0100)
committerChristian Schoenebeck <christian.schoenebeck@gmail.com>
Tue, 20 Dec 2016 19:09:50 +0000 (20:09 +0100)
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 <christian.schoenebeck@gmail.com>
net/ddns-scripts/Makefile
net/ddns-scripts/files/update_cloudflare_com_v4.sh
net/ddns-scripts/files/update_godaddy_com_v1.sh

index a9938c4eab1b8330aaa7d9f3be392eba94862290..2056dd776ebbffc2c69bcd8505b3b0bca274f4f4 100755 (executable)
@@ -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 <christian.schoenebeck@gmail.com>
index f07cd94704f000c328699aab9ebf8e0f3e43258c..d94f4c8bf64ba3e7d5629cbea9a1ad1f4fd583aa 100755 (executable)
@@ -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
 }
index 45fc0ccac85905db7f97b3bdee16742e08982a8f..5fc9925f6b7e267afde499d369bb05e0e5a1b60b 100755 (executable)
@@ -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
 }