Skip to content

Instantly share code, notes, and snippets.

@paulc
Created February 12, 2012 10:01
Show Gist options
  • Save paulc/1807662 to your computer and use it in GitHub Desktop.
Save paulc/1807662 to your computer and use it in GitHub Desktop.
Simple script to update joker.com DDNS
#!/bin/sh
set -x
NS=a.ns.joker.com
HOSTNAME=
USERNAME=
PASSWORD=
DDNS=$(dig @$NS $HOSTNAME +short)
IP=$(curl -s http://ifconfig.me)
if [ $IP != $DDNS ]
then
curl -q "http://svc.joker.com/nic/update?username=${USERNAME}&password=${PASSWORD}&hostname=${HOSTNAME}" | \
logger -t ddns -p alert
else
logger -t ddns -p alert No change: $IP
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment