ubuntu 16.04 startup script

Post your questions about SoftEther VPN software here. Please answer questions if you can afford.
Post Reply
Mada
Posts: 102
Joined: Sat Jun 20, 2015 9:40 am

ubuntu 16.04 startup script

Post by Mada » Sat Jul 16, 2016 5:21 pm

This works for me:

#!/bin/sh
### BEGIN INIT INFO
# Provides: vpnserver
# Required-Start: $all
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: vpnserver
# description: SoftEther VPN Server
### END INIT INFO
# chkconfig: 2345 99 01

DAEMON=/usr/local/vpnserver/vpnserver
LOCK=/var/lock/subsys/vpnserver
test -x $DAEMON || exit 0
case "$1" in
start)
$DAEMON start
touch $LOCK
;;
stop)
$DAEMON stop
rm $LOCK
;;
restart)
$DAEMON stop
sleep 3
$DAEMON start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0

Post Reply