Instantly share code, notes, and snippets.

What would you like to do?
CloudFlare Dynamic DNS
OLD_WAN_IP=`cat /var/CURRENT_WAN_IP.txt`
if [ "$WAN_IP" = "$OLD_WAN_IP" ]
echo "IP Unchanged"
curl \
-d 'a=rec_edit' \
-d 'tkn=8afbe6dea02407989af4dd4c97bb6e25' \
-d '' \
-d '' \
-d 'id=9001' \
-d 'type=A' \
-d 'name=sub' \
-d 'ttl=1' \
-d "content=$WAN_IP"
echo $WAN_IP > /var/CURRENT_WAN_IP.txt

This comment has been minimized.

pboertje commented May 23, 2014

Thanks! This is working for me!


This comment has been minimized.

windrof123 commented Mar 25, 2015



This comment has been minimized.

andreisusanu commented Mar 18, 2016

When will not be available, the script will go wild. You need to make sure that returns a proper IP address (maybe by using a regex), and only then update check if is new and proceed by updating the new IP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment