Created
February 22, 2013 03:33
-
-
Save erikbuild/5010516 to your computer and use it in GitHub Desktop.
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 | |
EMAIL="MY_EMAIL" | |
TOKEN="MY_API_KEY" | |
DOMAIN_ID="erikreynolds.com" | |
RECORD_ID="MY_NUMERIC_RECORD_ID" | |
echo "Getting current external IP" | |
IP="`curl -s http://icanhazip.com/`" | |
echo "Updating external record to $IP" | |
curl -H 'X-DNSimple-Token: $EMAIL:$TOKEN' \ | |
-H 'Accept: application/json' \ | |
-H "Content-Type: application/json" \ | |
-i -X PUT https://DNSimple.com/domains/$DOMAIN_ID/records/$RECORD_ID.json \ | |
-d {\\"record\\":{\\"content\\":\\"$IP\\"}} -s > /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment