DNSimple hostname updater on OS X (prior to Yosemite)
#!/bin/bash | |
. /etc/rc.common | |
AUTH_EMAIL='' # dnsimple account email address | |
AUTH_TOKEN='' # dnsimple api token | |
DOMAIN_ID='' # domain name or id | |
RECORD_ID='' # record id to update | |
IP="`curl http://icanhazip.com/`" | |
foo () | |
{ | |
curl -H "X-DNSimple-Token: $AUTH_EMAIL:$AUTH_TOKEN" \ | |
-H "Accept: application/json" \ | |
-H "Content-Type: application/json" \ | |
-X PUT \ | |
-d "{\"record\":{\"content\":\"$IP\"}}" \ | |
https://api.dnsimple.com/v1/domains/$DOMAIN_ID/records/$RECORD_ID | |
} | |
StartService () | |
{ | |
foo | |
} | |
# StopService () | |
# { | |
# } | |
RestartService () | |
{ | |
foo | |
} | |
RunService "$1" |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Description</key> | |
<string>DNSimple Dynamic Local IP Updater</string> | |
<key>OrderPreference</key> | |
<string>None</string> | |
<key>Provides</key> | |
<array> | |
<string>DNSimpleUpdater</string> | |
</array> | |
</dict> | |
</plist> |
This comment has been minimized.
This comment has been minimized.
OS X Yosemite removed the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
cd /Library/StartupItems
sudo /sbin/SystemStarter start "DNSimpleUpdater"