Alexey Sopov <suntechnic@gmail.com>
[vpnc.git] / vpnc-disconnect
blob6806b93e20d4fc8e2d06ce0206b43fc9385e112e
1 #!/bin/sh
3 pid=/var/run/vpnc/pid
5 if [ $# -ne 0 ]; then
6 echo "Usage: $0" 1>&2
7 exit 1
8 fi
10 PID="$(cat "$pid" 2> /dev/null)"
12 if [ -z "$PID" ]; then
13 echo "no vpnc found running"
14 exit 1
17 if ! kill -0 "$PID" > /dev/null 2>&1; then
18 echo "no vpnc found running"
19 exit 1
22 echo "Terminating vpnc daemon (pid: $PID)"
23 exec kill $PID