Skip to content

Instantly share code, notes, and snippets.

@bolasblack
Last active June 11, 2020 14:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bolasblack/9f53b048e46f538cf08d to your computer and use it in GitHub Desktop.
Save bolasblack/9f53b048e46f538cf08d to your computer and use it in GitHub Desktop.
/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
Copy link

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