Last active
October 8, 2017 02:53
-
-
Save geoffmyers/84640a983555ddc8318d4f6c597a9cd1 to your computer and use it in GitHub Desktop.
Cloudflare Dynamic DNS Simple Update Script
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
#!/usr/local/bin/zsh | |
IP_ADDRESS=$(curl ipecho.net/plain ; echo) | |
curl -X PUT "https://api.cloudflare.com/client/v4/zones/{zone_identifier}/dns_records/{identifier}" \ | |
-H "X-Auth-Email: {cloudflare_email_address}" \ | |
-H "X-Auth-Key: {cloudflare_api_key}" \ | |
-H "Content-Type: application/json" \ | |
--data "{\"type\":\"A\",\"name\":\"{domain_name}\",\"content\":\"$IP_ADDRESS\"}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment