IPv6 6in4 Tunnel via Hurricane Electric (Tunnelbroker.net): Automatic IP Update on Mac OS X

Hurricane Electric provides free IPv6 tunnels via the 6in4 protocol on the website tunnelbroker.net. After signing up, one can create up to 5 tunnels. When settings up a standard tunnel, one has to provide one's endpoint IPv4 address which may change from time to time (moving around or 24-hour reset of a DSL line). So one may want to automate the process of updating the tunnel endpoint on the HE website (plus the re-activation of tunnel on the local computer.

To do this automatic updating and tunnel recreation on Mac OS X 10.6, I found a usefull script by limemonkey in a post on the HE forum. I modified it and publish it here. To (re)activate the tunnel on Mac OS X, change the constants of this script according to your values (credentials on tunnelbroker.net) and run this bash script: