Last active
June 11, 2020 14:53
-
-
Save bolasblack/9f53b048e46f538cf08d to your computer and use it in GitHub Desktop.
/etc/init.d/ocserv
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
#!/sbin/runscript | |
DAEMON=/usr/local/sbin/ocserv | |
PIDFILE=/var/run/ocserv.pid | |
LOGFILE=/var/log/ocserv.log | |
DAEMON_ARGS="-f -d 1" | |
extra_commands="debug" | |
depend() { | |
use net | |
} | |
debug() { | |
$DAEMON $DAEMON_ARGS | |
} | |
start() { | |
ebegin "Starting OpenConnect VPN Server" | |
start-stop-daemon --start --quiet --background \ | |
--stdout $LOGFILE \ | |
--stderr $LOGFILE \ | |
--exec $DAEMON -- $DAEMON_ARGS | |
eend $? | |
} | |
stop() { | |
ebegin "Stoping OpenConnect VPN Server" | |
[ ! -f $PIDFILE ] || { kill -9 `cat $PIDFILE` && rm -rf $PIDFILE ; } | |
eend $? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hi! could you please present a complete sample of the ocserv.init, pls? i hv tried in inserting the code but failed.