Created
July 3, 2016 20:50
-
-
Save benyanke/e230ec5787cb7898f2d41a1e240619e3 to your computer and use it in GitHub Desktop.
update an A record in digital Ocean (digitalocean.com). Dynamic DNS style
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 | |
#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