Uploaded initial version.
[guivpn] / trunk / vpngui / src / vpngui-helper
diff --git a/trunk/vpngui/src/vpngui-helper b/trunk/vpngui/src/vpngui-helper
new file mode 100755 (executable)
index 0000000..43c309c
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+# Vpnc helper script for maemo
+
+if [ "$1" = "connect" ]; then
+       shift # need to remove "connect" from getting passed to vpnc
+       CMD="/usr/sbin/vpnc $*"
+       exec $CMD 
+
+elif [ "$1" = "disconnect" ]; then
+       # vpngui knows our pid..
+       kill -TERM $2 > /dev/null 2>&1
+       # In case that didn't work...
+       killall vpnc > /dev/null 2>&1
+       # ..and pretend everything went fine
+
+       exit 0
+
+elif [ "$1" = "reconnect" ]; then
+       # vpngui knows our pid..
+       kill -USR1 $2 > /dev/null 2>&1
+       exit 0
+
+else
+       exit 1
+fi
+
+# vim:ts=4