Created
February 18, 2014 00:19
-
-
Save marcy-terui/9062014 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=/usr/local/vpnclient/vpnclient | |
CMDPATH=/usr/local/vpnclient/vpncmd | |
CMDHOST=localhost | |
CMDCONN=local | |
IP4ADDRESS=192.168.100.1 | |
VIRTUALIF=vpn_adapter01 | |
LOCK=/var/lock/subsys/vpnclient | |
test -x $DAEMON || exit 0 | |
case "$1" in | |
start) | |
$DAEMON start | |
touch $LOCK | |
$CMDPATH /client $CMDHOST /cmd AccountConnect $CMDCONN | |
ifconfig $VIRTUALIF $IP4ADDRESS | |
;; | |
stop) | |
$DAEMON stop | |
rm $LOCK | |
;; | |
restart) | |
$DAEMON stop | |
sleep 3 | |
$DAEMON start | |
$CMDPATH $CMDTYPE $CMDHOST $CMDSUFFIX $CMDEXEC $CMDCONN | |
ifconfig $VIRTUALIF $IP4ADDRESS | |
;; | |
*) | |
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