Skip to content

Instantly share code, notes, and snippets.

@PhilipTrauner
Last active June 15, 2017 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PhilipTrauner/52b40bd07aebde905a0d680240d66f97 to your computer and use it in GitHub Desktop.
Save PhilipTrauner/52b40bd07aebde905a0d680240d66f97 to your computer and use it in GitHub Desktop.
Digital Ocean Dynamic DNS
#!/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