#!/bin/sh
#
# rplayd       This shell script takes care of starting and stopping
#              rplayd.
#
# chkconfig: 2345 91 11
# description: rplay is a flexible network audio system that allows sounds
#              to be played to and from local and remote Unix systems.
#
# processname: rplayd
# config:      /etc/rplay/rplay.conf
# config:      /etc/rplay/rplay.helpers
# config:      /etc/rplay/rplay.hosts
# config:      /etc/rplay/rplay.servers

PATH=/usr/bin:/sbin:/bin:/usr/sbin
RPLAYD_OPTIONS=/etc/sysconfig/rplayd
export PATH RPLAYD_OPTIONS

# 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 /usr/sbin/rplayd ] || exit 0

# See how we were called.
case "$1" in
  start)
	echo -n "Starting rplayd: "
	daemon rplayd --options-file=$RPLAYD_OPTIONS
	echo
	touch /var/lock/subsys/rplayd
	;;
  stop)
	echo -n "Shutting down rplayd: "
	killproc rplayd
	echo
	rm -f /var/lock/subsys/rplayd
	;;
  restart)
	$0 stop
	$0 start
	;;
  status)
	status rplayd
	;;
  *)
	echo "Usage: $0 {start|stop|restart|status}"
	exit 1
esac

exit 0
