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