Skip to content

Instantly share code, notes, and snippets.

@da-n
Created January 24, 2017 23:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save da-n/5daf8028e24698b068c4f460045b254a to your computer and use it in GitHub Desktop.
Save da-n/5daf8028e24698b068c4f460045b254a to your computer and use it in GitHub Desktop.
Update DtDNS Bash Script
#!/usr/bin/bash
DOMAIN=
PASSWORD=
IPADDR=`wget -qO- tnx.nl/ip`
LASTIP=`nslookup bitmono.dtdns.net ns1.darktech.org | grep -A1 bitmono | grep Address | awk '{ print $2 }'`
echo -n "`date` - "
if [ "$IPADDR" != "$LASTIP" ]; then
echo -e "GET /api/autodns.cfm?id=$DOMAIN&pw=$PASSWORD&client=BSD
HTTP/1.1\nHost: www.dtdns.com\nUser-Agent: bash\n\n" | \
nc www.dtdns.com 80 > /dev/null 2>&1
echo "Posted IP change from $LASTIP to $IPADDR"
else
echo "IP still $IPADDR"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment