— pissing into the wind

ventrilo startup script

I made a post over at http://ubuntuforums.org/showthread.php?t=1609521&highlight=ventrilo, but here’s a startup script I put together for Ventrilo 3.0.

#!/bin/sh
#
### BEGIN INIT INFO
# Provides:          ventrilo_srv
# Required-Start:    $network $remote_fs $syslog
# Required-Stop:     $network $remote_fs $syslog
# Should-Start:      $named
# Should-Stop:       $named
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Ventrilo version 3.0
### END INIT INFO

NAME=ventrilo_srv
DESC=”Ventrilo 3.0″
DAEMON=/usr/local/ventrilo/ventrilo_srv
PIDFILE=/usr/local/ventrilo/$NAME.pid
DAEMON_ARGS=”-f/usr/local/ventrilo/ventrilo_srv -d”
VENT_USER=ventrilo

do_start() {

        start-stop-daemon –quiet –start \
                –user $VENT_USER \
                –chuid $VENT_USER \
                –pidfile $PIDFILE \
                –exec $DAEMON — $DAEMON_ARGS < /dev/null
        return $?

}

do_stop() {
        start-stop-daemon –stop –quiet \
                –retry=TERM/30/KILL/5 \
                –pidfile $PIDFILE \
                –name $NAME
        rm -f $PIDFILE
        return “$?”
}

case “$1” in
start)
        do_start
        ;;

stop)
        do_stop
        ;;

restart|reload|force-reload)
        do_stop
        sleep 10
        do_start
        ;;

*)
        echo “Usage: $0 start|stop|restart|reload|force-reload”
        exit 1
        ;;

0 comments
Submit comment