dhcpcd-discuss

vpnc no autorestart

Roman

Sun Jan 08 14:06:56 2012

Hi,

i think i already posted about the initial problem some time ago 
(automatically start vpnc after wifi-connection has been established).

For that (and saving power) i created a couple of files. The problem is that 
sometimes the wifi-connection dies and vpn is stopped and when the connection 
gets reestablished the vpnc won't start.

Is there a problem with the scripts? Or does this indicate another problem?

Any help appreciated!

/lib/dhcpcd/dhcpcd-hooks/90-x200.conf:
#!/bin/sh
wlan_up(){
        iwconfig wlan0 txpower 10
        ifconfig wlan0 up
        /etc/init.d/wpa_supplicant start
}

wlan_down(){
        ifconfig wlan0 down
        iwconfig wlan0 txpower off
        /etc/init.d/wpa_supplicant stop
}

if [ "$interface" = "eth0" ]; then
        case "$reason" in
                "NOCARRIER"|"STOP")
                        wlan_up;;
                *)
                        wlan_down;;
        esac
fi

/usr/local/sbin/vpnc.hrz
#!/bin/sh
# Run vpnc after connecting

if [ "$interface" = "wlan0" ]; then
        case "$reason" in
                "BOUND"|"REBIND")
                        [ -f /var/run/vpnc/pid ] && \
		/usr/sbin/vpnc-disconnect || /usr/sbin/vpnc /etc/vpnc/unibn-wlan.conf
                        ;;
                "*")
                        ;;
        esac
fi

And this in /etc/dhcpcd.conf:
sid bonnet
        script /usr/local/sbin/vpnc.hrz
interface tun0
        nohook resolv.conf


greetings,
Romnan
-- 
How come everyone's going so slow if it's called rush hour?

Archive administrator: postmaster@marples.name