3 defr
=/var
/run
/vpnc
/defaultroute
4 gateway
=/var
/run
/vpnc
/gateway
12 PID
="$(cat "$pid" 2> /dev/null)"
14 if [ -z "$PID" ]; then
15 echo "no vpnc found running"
19 if ! kill -0 "$PID" > /dev
/null
2>&1; then
20 echo "no vpnc found running"
24 echo "Terminating vpnc daemon (pid: $PID)"
27 # this still sucks. Invent something to sync route removal/addition with
30 if [ -s "$defr" ]; then
31 ip route del default
> /dev
/null
2>&1
32 ip route add $
(cat "$defr")
33 test -r "$gateway" && ip route del $
(cat "$gateway")
37 rm -f -- "$defr" "$pid" "$gateway"