From b5f58de17e55d78e937479aa7d457e1d8ff6e9a0 Mon Sep 17 00:00:00 2001 From: Xiaoming Wang Date: Tue, 28 Apr 2020 16:52:41 +0800 Subject: [PATCH] fix issue #5 https://github.com/yulewang/cloudflare-api-v4-ddns/issues/5 cf-v4-ddns.sh: line 140: [: !=: unary operator expected Something went wrong :( --- cf-v4-ddns.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cf-v4-ddns.sh b/cf-v4-ddns.sh index 0b0ed8b..b4bf85d 100644 --- a/cf-v4-ddns.sh +++ b/cf-v4-ddns.sh @@ -137,7 +137,7 @@ RESPONSE=$(curl -s -X PUT "https://api.cloudflare.com/client/v4/zones/$CFZONE_ID -H "Content-Type: application/json" \ --data "{\"id\":\"$CFZONE_ID\",\"type\":\"$CFRECORD_TYPE\",\"name\":\"$CFRECORD_NAME\",\"content\":\"$WAN_IP\", \"ttl\":$CFTTL}") -if [ "$RESPONSE" != "${RESPONSE%success*}" ] && [ $(echo $RESPONSE | grep "\"success\":true") != "" ]; then +if [ "$RESPONSE" != "${RESPONSE%success*}" ] && [ "$(echo $RESPONSE | grep "\"success\": true")" != "" ]; then echo "Updated succesfuly!" echo $WAN_IP > $WAN_IP_FILE exit