Skip to content

Instantly share code, notes, and snippets.

@benyanke
Created July 3, 2016 20:50
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 benyanke/e230ec5787cb7898f2d41a1e240619e3 to your computer and use it in GitHub Desktop.
Save benyanke/e230ec5787cb7898f2d41a1e240619e3 to your computer and use it in GitHub Desktop.
update an A record in digital Ocean (digitalocean.com). Dynamic DNS style
#!/bin/bash
#update an A record in digital Ocean. Dynamic DNS style.
#API info here:
#https://developers.digitalocean.com/#domains-list
#your domain ID
domain_id="XXX"
#record to update
record_id="XXX"
#digitalocean client_id
client_id="XXX"
#your api key
api_key="XXX"
### don't change ###
ip="$(curl http://ipecho.net/plain)"
api="https://api.digitalocean.com/domains/$domain_id/records/$record_id/edit"
echo content="$(curl -s "$api?data=$ip&client_id=$client_id&api_key=$api_key")"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment