Created
March 4, 2015 12:56
-
-
Save studiomohawk/bae8642e2e9ded50a0bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# chkconfig: 2345 99 01 | |
# description: SoftEther VPN Client | |
DAEMON=/home/vagrant/vpnclient/vpnclient | |
LOCK=/var/lock/subsys/vpnclient | |
IFUP=/sbin/ifup | |
IFDOWN=/sbin/ifdown VPN=vpn_vpn | |
test -x $DAEMON || exit 0 | |
case "$1" in | |
start) | |
$DAEMON start | |
touch $LOCK | |
sleep 5 | |
$IFDOWN $VPN | |
sleep 10 | |
$IFUP $VPN | |
;; | |
stop) | |
$DAEMON stop | |
rm $LOCK | |
;; | |
restart) | |
$DAEMON stop | |
sleep 3 | |
$DAEMON start | |
;; | |
*) | |
echo "Usage: $0 {start|stop|restart}" | |
exit 1 | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment