Created
December 17, 2018 14:23
-
-
Save ndunks/59c10c3006d4bb036fd23a3fb0ff1a4e to your computer and use it in GitHub Desktop.
Cloudflare Update DNS IP with bash
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/bash | |
ip=$(curl -s https://api.ipify.org/) | |
echo "DDNS-UPDATE: Public IP is: $ip, Updating IP..." | |
host=home.klampok.id | |
curl -X PUT "https://api.cloudflare.com/client/v4/zones/00000000000000000000/dns_records/00000000000000000000000" \ | |
-H "X-Auth-Email: *******@gmail.com" \ | |
-H "X-Auth-Key: *******" \ | |
-H "Content-Type: application/json" \ | |
--data '{"type":"A","name":"home.klampok.id","content":"'"$ip"'","ttl":120,"proxied":false}' ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment