ddns-scripts: cloudflare.com-v4: Fix success check for new response format
authorMichael Gray <michael.gray@lantisproject.com>
Sat, 25 Apr 2020 05:34:56 +0000 (15:34 +1000)
committerJeffery To <jeffery.to@gmail.com>
Fri, 8 May 2020 07:38:17 +0000 (15:38 +0800)
JSON response now has spaces between parameters. Accept this new format and the old one.

Signed-off-by: Michael Gray <michael.gray@lantisproject.com>
(cherry picked from commit 0080bb4bba61171dd2b0654ce36359e5191db01a)

net/ddns-scripts/files/update_cloudflare_com_v4.sh

index dbf6f592bfba7dc0c2432402c72ef19b8c7f5608..7e663ac424d489b47d368911228018c1eef27bd5 100755 (executable)
@@ -85,7 +85,7 @@ cloudflare_transfer() {
        done
 
        # check for error
-       grep -q '"success":true' $DATFILE || {
+       grep -q '"success": \?true' $DATFILE || {
                write_log 4 "CloudFlare reported an error:"
                write_log 7 "$(cat $DATFILE)"           # report error
                return 1        # HTTP-Fehler