https://github.com/yulewang/cloudflare-api-v4-ddns/issues/5

cf-v4-ddns.sh: line 140: [: !=: unary operator expected
Something went wrong :(
This commit is contained in:
Xiaoming Wang 2020-04-28 16:52:41 +08:00
parent abc40f5e03
commit b5f58de17e

View File

@ -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