#!/bin/bash # # gnump3d This shell script takes care of starting and stopping # gnump3d. # # chkconfig: 345 99 9 # description: gnump3d is a streaming mp3 daemon with a \ # built in webserver. # probe: true # pidfile: /var/run/gnump3d.pid # config: /etc/gnump3d.conf # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ "${NETWORKING}" = "no" ] && exit 0 [ -f /etc/gnump3d.conf ] || exit 0 [ -f /usr/sbin/gnump3d ] || exit 0 # See how we were called. case "$1" in start) gprintf "Starting gnump3 daemon: " daemon gnump3d --config /etc/gnump3d.conf \ --background --pid /var/run/gnump3d.pid echo touch /var/lock/subsys/gnump3d ;; stop) gprintf "Shutting down gnump3 daemon: " killproc gnump3d echo rm -f /var/lock/subsys/gnump3d ;; status) status gnump3d ;; restart|reload) $0 stop $0 start ;; condrestart) [ -f /var/lock/subsys/gnump3d ] && restart ;; *) gprintf "Usage: gnump3 {start|stop|status|restart|condrestart|reload}\n" exit 1 esac exit 0