Last active
June 15, 2017 15:40
-
-
Save PhilipTrauner/52b40bd07aebde905a0d680240d66f97 to your computer and use it in GitHub Desktop.
Digital Ocean Dynamic DNS
This file contains hidden or 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 | |
API_TOKEN="" | |
DOMAIN="" | |
PUBLIC_IPV4=$(curl -s ifconfig.co) | |
RECORD_ID="" | |
curl -s -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer ${API_TOKEN}" -d '{"data":"'"${PUBLIC_IPV4}"'"}' "https://api.digitalocean.com/v2/domains/${DOMAIN}/records/${RECORD_ID}" > /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment