Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/etc/init.d/ocserv
#!/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 $?
}
@singhigh

This comment has been minimized.

Copy link

commented Mar 17, 2016

hi! could you please present a complete sample of the ocserv.init, pls? i hv tried in inserting the code but failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.