Couple of notes regarding the updated web interface:
1) To update your tunnel's IPv4 endpoint, click on the tunnel for the details page, then click on your listed IPv4 endpoint. This will open a new page where you enter your new IPv4 endpoint address, and click submit to make the change.
Its occuring (as always occurs by murphy law) that my IPv4 endpoint address, choose to
changes IPv4 endpoint address, ONLY every time I'm away for some reason :lol:
example: I go to asleep , or I go to a meeting ... , etc.
Well , the day after I get fully automatic on updating my endpoint address
that updated web interface (excelent update for human use
rendered my script not working anymore :cry:
imho: there is no need to any web interface update to break any script
*just left the old php web interface into the web server (umodifyed)
*that old interface is accessible only by typing its full url ...
so, despite web page has been changed for humans use and shows up in java script instead of in php
*scripts contine working
btw: I have this entry in crontab
*/7 * * * * root /root/dns
this is the dns script
#!/bin/bash
cd /root/dyndns
/sbin/ip link show up | grep ppp0 &> /dev/null
if [ $? -eq 0 ]; then
# ./ipcheck.py -s -w -ippp0 --acctfile dados -d roberto.dnsalias.com
./ipcheck.py -w -ippp0 --acctfile dados -d roberto.dnsalias.com
./ipcheck.py -w -ippp0 --acctfile dados2 -d konectrix.dnsalias.com
./updateipv4.sh
fi
#/sbin/ip link show up | grep eth1 &> /dev/null
#if [ $? -eq 0 ];then
# ./ipcheck.py -s -w -ieth1 --acctfile dados -d roberto.dnsalias.com
# ./ipcheck.py -w -ieth1 --acctfile dados2 -d konectrix.dnsalias.com
#fi
cd -
and this is the script that get broken cause the removal of the php code from he-ipv6 web server
[root@crobertp dyndns]# cat updateipv4.sh
#!/bin/sh
#############################
# Hurricane's TunnelBroker Endpoint ipv4 address updater
# ------------------------------------------------------
#
# Command line usage:
# % updateipv4 [ipv4 [ tunnel_id [ login password ] ] ]
#
# Defaults values are taken from below
#
#############################
##################
# DEFAULT VALUES
##################
LOGIN="your_userid"
PASSWORD="your_password"
TUNNELID="12345" # your_tunnelid
# When empty, IPv4 value is fetched from whatismyip
# Modificacao local to get ip from ppp0 /* crp * 22 jul 2008 */
IPV4=$(ip -4 addr show dev ppp0 | awk '/inet/ {print $2}' | cut -d/ -f1)
O_IPV4=$( cat "O_IPV4")
if [ ".$O_IPV4" == ".$IPV4" ]
then exit
fi
echo $IPV4 > "O_IPV4"
exit # exit here cause php code on Hurricanes was removed
##########################################
# http headers templates
COOKIETEMPLATE="GET /index.php HTTP/1.1
Host: tunnelbroker.net
"
LOGINTEMPLATE="POST /index.php?COOKIE HTTP/1.1
Host: tunnelbroker.net
Referer: http://tunnelbroker.net/index.php
Content-Type: application/x-www-form-urlencoded
Content-Length: POSTSIZE
POSTDATA"
UPDATETEMPLATE="POST /ipv4_end.php?COOKIE&tunnelid=TUNNEL_ID HTTP/1.1
Host: tunnelbroker.net
Cookie: COOKIE
Content-Type: application/x-www-form-urlencoded
Content-Length: POSTSIZE
POSTDATA"
##########################################
# check if we're a host with busybox and need to strip some options
if [ -e '/bin/busybox' ]
then
TIMEOUTOPTION=''
else
TIMEOUTOPTION='20'
fi
# replace default parameters with command line ones
if [ ! -z $4 ]; then LOGIN=$4 ; fi
if [ ! -z $3 ]; then PASSWORD=$3 ; fi
if [ ! -z $2 ]; then TUNNELID=$2 ; fi
if [ ! -z $1 ]; then IPV4=$1 ; fi
# if we don't already know our new ip, let's find it by ourself
if [ -z "${IPV4}" ]
then
IPV4=`wget http://whatismyip.com/automation/n09230945.asp -O - 2>/dev/null`
if [ `expr length $IPV4` -gt 15 ]
then
echo "-IP Guess Failed."
exit 1
else
echo "+Guessed IP:"$IPV4
fi
fi
MD5PASSWORD=`echo -n $PASSWORD | md5sum | sed -e 's/ -//g'`
# sed command parsing hack, @ for &
LOGINPOSTDATA='username='$LOGIN'@clearpass=@password='$MD5PASSWORD'@Login=Login'
LOGINPOSTDATASIZE=`expr length "$LOGINPOSTDATA"`
UPDATEPOSTDATA='ipv4b='$IPV4'@update=Submit'
UPDATEPOSTDATASIZE=`expr length "$UPDATEPOSTDATA"`
echo "+Set password hash: "$MD5PASSWORD
# Get session cookie
echo "+Requesting cookie"
MYCOOKIE=`echo "${COOKIETEMPLATE}" | nc tunnelbroker.net 80 $TIMEOUTOPTION | grep Cookie | tr -d '{\r\n}' | sed -e 's+Set-Cookie: ++' -e 's+; path=/++'`
echo "+Got cookie value: "$MYCOOKIE
# log in with cookie and credentials
echo "+Logging in"
echo "${LOGINTEMPLATE}" | sed -e 's/POSTDATA/'$LOGINPOSTDATA'/' -e 's/POSTSIZE/'$LOGINPOSTDATASIZE'/' -e 's+COOKIE+'$MYCOOKIE'+' | tr '@' '&' \
| nc tunnelbroker.net 80 $TIMEOUTOPTION > /dev/null
echo "${LOGINTEMPLATE}" | sed -e 's/POSTDATA/'$LOGINPOSTDATA'/' -e 's/POSTSIZE/'$LOGINPOSTDATASIZE'/' -e 's+COOKIE+'$MYCOOKIE'+' | tr '@' '&' \
| nc tunnelbroker.net 80 $TIMEOUTOPTION > /dev/null
echo "+Switching tunnel" $TUNNELID "to: "$IPV4
# Update the tunnel ip endpoint
SUCCESS=`echo "${UPDATETEMPLATE}" | sed -e 's/POSTDATA/'$UPDATEPOSTDATA'/' -e 's/POSTSIZE/'$UPDATEPOSTDATASIZE'/' -e 's+COOKIE+'$MYCOOKIE'+g' \
-e 's+TUNNEL_ID+'$TUNNELID'+' | tr '@' '&' \
| nc tunnelbroker.net 80 $TIMEOUTOPTION | grep "IPv4 endpoint has been updated\|That IPv4 endpoint is already in use"`
if [ -z "${SUCCESS}" ]
then
echo "-Update FAILED"
exit 1
else
echo "+Updated Successfully"
#put here your code to do ifdown / ifup on sit0 / sit1 -and/or- he-ipv6
exit 0
fi
########################################
# v 0.5 Francois Cartegnie
# e-mail: echo "spnegrtavr@serr.se" | tr A-Za-z N-ZA-Mn-za-m
#
[root@crobertp dyndns]#
TIA