aboutsummaryrefslogtreecommitdiffstats
path: root/package/strongswan/files/ipsec.button
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2007-02-28 13:30:51 +0000
committerFlorian Fainelli <florian@openwrt.org>2007-02-28 13:30:51 +0000
commit5ee1f53cb1190bae51e43e1469a3c89f380376ee (patch)
tree9651a517795b0064548993905ffe2979e28fdd7a /package/strongswan/files/ipsec.button
parent96c42dce806b42e947a743453e09dbff20c804d7 (diff)
downloadupstream-5ee1f53cb1190bae51e43e1469a3c89f380376ee.tar.gz
upstream-5ee1f53cb1190bae51e43e1469a3c89f380376ee.tar.bz2
upstream-5ee1f53cb1190bae51e43e1469a3c89f380376ee.zip
Add strongswan (#1330)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6429 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/strongswan/files/ipsec.button')
-rw-r--r--package/strongswan/files/ipsec.button34
1 files changed, 34 insertions, 0 deletions
diff --git a/package/strongswan/files/ipsec.button b/package/strongswan/files/ipsec.button
new file mode 100644
index 0000000000..9bd9023560
--- /dev/null
+++ b/package/strongswan/files/ipsec.button
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+# snarf the code that loads the config values
+# since we also load the functions, might as well save the shell calls
+. /etc/init.d/ipsec
+
+[ -n "$IPSEC_RESET_BUTTON" -a "$BUTTON" = "$IPSEC_RESET_BUTTON" ] || exit
+
+if [ ! -e /var/run/pluto.pid ] ; then
+
+ [ "$ACTION" = "pressed" ] && start
+
+else
+
+ if [ "$ACTION" = "pressed" ] ; then
+
+ stop
+
+ elif [ "$ACTION" = "released" ] ; then
+
+ while [ -e /var/run/pluto.pid ] ; do
+ sleep 1
+ done
+
+ while ps auxww | grep ipsec | grep -v grep ; do
+ sleep 1
+ done
+
+ start
+
+ fi
+
+fi
+