diff options
author | Florian Fainelli <florian@openwrt.org> | 2007-02-28 13:30:51 +0000 |
---|---|---|
committer | Florian Fainelli <florian@openwrt.org> | 2007-02-28 13:30:51 +0000 |
commit | c3521420dc2ddd0535690ab6569cd57c4b078035 (patch) | |
tree | 4b1f3ed52b3ea4d610732c7f0fbbf32d14f2cc57 /package/strongswan/files/ipsec.button | |
parent | 15a9b61bbd1c7d1dec7cdb0992462356aec63905 (diff) | |
download | mtk-20170518-c3521420dc2ddd0535690ab6569cd57c4b078035.zip mtk-20170518-c3521420dc2ddd0535690ab6569cd57c4b078035.tar.gz mtk-20170518-c3521420dc2ddd0535690ab6569cd57c4b078035.tar.bz2 |
Add strongswan (#1330)
SVN-Revision: 6429
Diffstat (limited to 'package/strongswan/files/ipsec.button')
-rw-r--r-- | package/strongswan/files/ipsec.button | 34 |
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 0000000..9bd9023 --- /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 + |