Skip to content

Instantly share code, notes, and snippets.

@gitllermopalafox
Last active August 29, 2015 14:10
Show Gist options
  • Save gitllermopalafox/aab33a42c1fa43bf4b7b to your computer and use it in GitHub Desktop.
Save gitllermopalafox/aab33a42c1fa43bf4b7b to your computer and use it in GitHub Desktop.
#!/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