mirror of
https://github.com/aipeach/cloudflare-api-v4-ddns.git
synced 2025-01-18 22:09:28 +08:00
Update cf-v4-ddns.sh
Bug fixed
This commit is contained in:
parent
774878f6a1
commit
8b5fd9ea4b
@ -120,7 +120,7 @@ RESPONSE=$(curl -s -X PUT "https://api.cloudflare.com/client/v4/zones/$CFZONE_ID
|
|||||||
-H "X-Auth-Email: $CFUSER" \
|
-H "X-Auth-Email: $CFUSER" \
|
||||||
-H "X-Auth-Key: $CFKEY" \
|
-H "X-Auth-Key: $CFKEY" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
--data "{\"id\":\"$CFZONE_ID\",\"type\":\"A\",\"name\":\"$CFRECORD_NAME\",\"content\":\"$WAN_IP\", \"ttl\":\"$CFTTL\"}")
|
--data "{\"id\":\"$CFZONE_ID\",\"type\":\"A\",\"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 "Updated succesfuly!"
|
||||||
@ -130,4 +130,4 @@ else
|
|||||||
echo 'Something went wrong :('
|
echo 'Something went wrong :('
|
||||||
echo "Response: $RESPONSE"
|
echo "Response: $RESPONSE"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user