Last active
August 29, 2015 14:03
-
-
Save MattRK/e822edc5ea35ff128168 to your computer and use it in GitHub Desktop.
CloudFlare Dynamic DNS Update Script for AsusWRT-Merlin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#Wait 30 seconds so that the WAN can come up properly before continuing | |
sleep 30 | |
#Get the new IP | |
IP=`wget -O - -q http://icanhazip.com` | |
#Update Cloudflare with the new IP | |
/opt/bin/wget -O - -q https://www.cloudflare.com/api_json.html --no-check-certificate --post-data "a=rec_edit&tkn=[YOUR API TOKEN]&email=[YOUR EMAIL ADDRESS]&z=[YOUR ZONE NAME]&id=[YOUR RECORD ID]&type=A&name=[RECORD NAME]&ttl=1&content=$IP" | |
#Log the event | |
logger DHCPC-EVENT SCRIPT: CloudFlare has been updated to $IP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment