Commit d1a9d64

Dan Krause <dan.krause@rackspace.com>
2013-05-23 14:07:20
added shell script version of dynhover
1 parent e13b1f8
Changed files (1)
dynhover.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+[[ $# -lt 3 ]] && echo "Usage: $0 USERNAME PASSWORD DNS_ID"
+
+USERNAME=${1}
+PASSWORD=${2}
+DNS_ID=${3}
+
+# find your DNS ID here: https://www.hover.com/api/domains/yourdomain.com/dns/
+
+# (replace "yourdomain.com" with your actual domain, and look for the record
+# you want to change. The ID looks like: dns1234567)
+
+IP=$(curl "http://api.exip.org/?call=ip" -s)
+
+curl "https://www.hover.com/api/dns/${DNS_ID}" \
+     -X PUT            \
+     -d "content=${IP}" \
+     -s                \
+     -b <(curl "https://www.hover.com/signin" \
+               -X POST                   \
+               -G                        \
+               -d "username=${USERNAME}" \
+               -d "password=${PASSWORD}" \
+               -s                        \
+               -o /dev/null              \
+               -c -)
+
+echo
+