Skip to content

Instantly share code, notes, and snippets.

@tracyhatemice
Forked from bolasblack/ocserv.init
Created March 23, 2016 08:38
Show Gist options
  • Save tracyhatemice/1c3fa04c7d4884a15759 to your computer and use it in GitHub Desktop.
Save tracyhatemice/1c3fa04c7d4884a15759 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 $?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment