#!/bin/sh # # chkconfig: 345 99 9 ### BEGIN INIT INFO # Provides: gnump3d # Required-Start: $network # Required-Stop: $network # Default-Start: 345 # Short-Description: Starts the gnump3d daemon # Description: gnump3d is a streaming mp3 daemon with a built in webserver. ### END INIT INFO NAME=gnump3d LOCKFILE=/var/lock/subsys/$NAME # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ "${NETWORKING}" = "no" ] && exit 0 start() { echo -n "Starting gnump3d:" daemon gnump3d --background --pid /var/run/gnump3d.pid RETVAL=$? [ $RETVAL -eq 0 ] && touch $LOCKFILE echo } stop() { echo -n "Stopping $NAME:" killproc gnump3d RETVAL=$? [ $RETVAL -eq 0 ] && rm -f $LOCKFILE echo } RETVAL=0 # See how we were called. case "$1" in start) start ;; stop) stop ;; status) status gnump3d ;; restart|reload) start stop ;; condrestart) if [ -f $LOCKFILE ]; then restart fi ;; *) echo "Usage: $0 {start|stop|restart|reload|condrestart|condreload|status}" exit 1 esac exit $RETVAL