Skip to content

Instantly share code, notes, and snippets.

@marcy-terui
Created February 18, 2014 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcy-terui/9062014 to your computer and use it in GitHub Desktop.
Save marcy-terui/9062014 to your computer and use it in GitHub Desktop.
#!/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