summaryrefslogtreecommitdiff
path: root/social/strongswan/strongswan.rc
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2011-10-28 23:14:50 +0000
committerroot <root@rshg054.dnsready.net>2011-10-28 23:14:50 +0000
commit807f42c30ddb00c4e2d4034ce1720d7cb494e074 (patch)
tree80b0599366bffbfa57def09ed036e6ad635f1796 /social/strongswan/strongswan.rc
parent0424b5fc47f106db6498c4cda3476e1d49fe0f82 (diff)
Fri Oct 28 23:14:50 UTC 2011
Diffstat (limited to 'social/strongswan/strongswan.rc')
-rwxr-xr-xsocial/strongswan/strongswan.rc43
1 files changed, 43 insertions, 0 deletions
diff --git a/social/strongswan/strongswan.rc b/social/strongswan/strongswan.rc
new file mode 100755
index 000000000..58c99c092
--- /dev/null
+++ b/social/strongswan/strongswan.rc
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+case "$1" in
+ start)
+ stat_busy "Starting strongSwan IPsec"
+ /usr/sbin/ipsec start
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ stat_done
+ add_daemon strongswan
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping strongSwan IPsec"
+ /usr/sbin/ipsec stop
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ stat_done
+ rm_daemon strongswan
+ fi
+ ;;
+ restart)
+ stat_busy "Restarting strongSwan IPsec"
+ /usr/sbin/ipsec restart
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ stat_done
+ add_daemon strongswan
+ fi
+ ;;
+ status)
+ /usr/sbin/ipsec status
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart|status}"
+esac
+