Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Small Script to update Tunnelbroker IPv4-address
#!/bin/sh
USERID=<USERID from TUNNELBROKER.NET>
PASSWORD=<PASSWORD>
TUNNELID=<YOUR TUNNEL ID>
LOGSTATE=/tmp/updatehe.stat
if [ -e "$LOGSTATE" ] ; then
LASTIP=`cat $LOGSTATE`
fi
CURRENTIP=`curl -s checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'`
MD5PASS=`echo -n $PASSWORD | md5sum | cut -f 1 -d" "`
if [ "$LASTIP" = "$CURRENTIP" ] ; then
echo "No update necessary for IP $LASTIP"
else
echo "Need to update $LASTIP to $CURRENTIP"
curl "https://ipv4.tunnelbroker.net/ipv4_end.php?ip=$CURRENTIP&pass=$MD5PASS&apikey=$USERID&tid=$TUNNELID"
echo $CURRENTIP > $LOGSTATE
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.