# $Id: dhclient-exit-hooks,v 1.5 2002/10/29 20:14:48 lha Exp lha $ # # cool things you want to do in your dhclient-exit-hook file # love_remove_v6() { ifconfig $1 | grep inet6 | cut -f1-2 -d' ' | while read x; do if expr "$x" : "inet6 fe80::" > /dev/null; then : else ifconfig $1 $x delete fi done } setup_tsp_tunnel() { ifconfig gif0 destroy > /dev/null 2>/dev/null ifconfig gif0 create > /dev/null 2>/dev/null echo "using tsp tunnel to kth" love_remove_v6 $interface > /dev/null 2>/dev/null #rm -f /var/run/tspc.log #(cd /var/run && /usr/local/freenet/bin/tspc -f \ # /usr/local/freenet/bin/tspc.conf >/dev/null 2>/dev/null) } #echo "$reason" > /tmp/foo-file case "$reason" in PREINIT) case "$interface" in wi*|ath*) expr "$interface" : "wi" > /dev/null 2>&1 && \ /usr/sbin/wiconfig $interface -s 'nutcracker' # scaning for netname and setting WEP keys /usr/local/sbin/wi-scan $interface ifconfig "$interface" down sleep 1 ifconfig "$interface" up ;; esac ;; BOUND|RENEW|REBIND) case $new_ip_address in # kth networks have local ipv6, at least some of them 130.237.48.*|130.237.49.*|130.237.50.*|130.237.51.*|130.237.7.*|130.237.225.*|130.237.95.*|130.237.90.*|130.237.237.*|213.89.255.*) echo "trying rtsol" /sbin/rtsol $interface ;; 128.*) #CMU ;; *) setup_tsp_tunnel ;; esac echo start processing mail test -x /usr/sbin/sendmail && /usr/sbin/sendmail -q & ;; EXPIRE|FAIL|RELEASE|STOP) ifconfig gif0 destroy > /dev/null 2>/dev/null ifconfig gif0 create > /dev/null 2>/dev/null love_remove_v6 $interface > /dev/null 2>/dev/null route delete -inet6 default > /dev/null 2>/dev/null #/etc/rc.d/named9 restart ;; esac