Created
July 3, 2014 12:43
-
-
Save skhokhlov/b817362f11f660fda92e to your computer and use it in GitHub Desktop.
Dtdns updater
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/bash | |
IPADDR=`ifconfig -a | grep -A1 ed0 | grep inet | awk '{ print $2 }'` | |
LASTIP=`nslookup canth.dtdns.net ns1.darktech.org | grep -A1 canth | | |
grep Address | awk '{ | |
print $2 }'` | |
echo -n "`date` - " | |
if [ "$IPADDR" != "$LASTIP" ]; then | |
echo -e "GET /api/autodns.cfm?id=canth&pw=xxxxxxx&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