Created
September 10, 2014 21:51
-
-
Save tunix/1161ce0ce713d5cee0b3 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 | |
# Digital Ocean API Token | |
TOKEN="" | |
# Domain Details | |
DOMAIN="" | |
RECORD_ID="" | |
IP=$(curl -s ifconfig.me) | |
echo --- $(date +'%d.%m.%Y, %H:%M:%S') Start --- | |
curl -s -X PUT "https://api.digitalocean.com/v2/domains/$DOMAIN/records/$RECORD_ID" \ | |
-d'{"data":"'$IP'"}' \ | |
-H "Authorization: Bearer $TOKEN" \ | |
-H "Content-Type: application/json" | |
echo --- $(date +'%d.%m.%Y, %H:%M:%S') End --- | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment