Last active
August 29, 2015 14:21
-
-
Save josephabrahams/9bddefaa985b79e37ce8 to your computer and use it in GitHub Desktop.
DNSimple Dynamic DNS Shell Script
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/sh | |
TOKEN="your-domain-api-token" | |
DOMAIN_ID="yourdomain.com" | |
RECORD_ID="12345" # Replace with the Record ID | |
IP="`curl http://jsonip.com | sed 's/{"ip":"\(.*\)"/\1/g' | sed 's/}//'`" | |
curl -H "Accept: application/json" \ | |
-H "Content-Type: application/json" \ | |
-H "X-DNSimple-Domain-Token: $TOKEN" \ | |
-X "PUT" \ | |
-i "https://api.dnsimple.com/v1/domains/$DOMAIN_ID/records/$RECORD_ID" \ | |
-d "{\"record\":{\"content\":\"$IP\"}}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://developer.dnsimple.com/ddns/