summaryrefslogtreecommitdiff
path: root/testing/vpnc/vpnc.rc
diff options
context:
space:
mode:
Diffstat (limited to 'testing/vpnc/vpnc.rc')
-rw-r--r--testing/vpnc/vpnc.rc35
1 files changed, 35 insertions, 0 deletions
diff --git a/testing/vpnc/vpnc.rc b/testing/vpnc/vpnc.rc
new file mode 100644
index 000000000..972ed3211
--- /dev/null
+++ b/testing/vpnc/vpnc.rc
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+case "$1" in
+ start)
+ stat_busy "Connecting to VPN"
+ /usr/sbin/vpnc
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon vpnc
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Disconnecting from VPN"
+ /usr/sbin/vpnc-disconnect
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon vpnc
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0