#!/bin/sh -e
#
# created by Adam Culp of Unique Web Sites, Inc.
# at www.uniquewebsites.com
#
# darwinssd     Startup script for the Darwin Streaming Server
#
# chkconfig: 345 85 15
# description: Darwin Streaming Server startup/shutdown script
# processname: darwinssd
# pidfile: /var/run/darwinssd.pid

darwinssd=/usr/local/sbin/DarwinStreamingServer
RETVAL=0

# Source function library.
#. /etc/rc.d/init.d/functions

case "$1" in
start)
echo -n "Starting Darwin Streaming Server[darwinssd]: "
$darwinssd
RETVAL=$?
echo
touch /var/run/darwinssd
;;
stop)
echo -n "Shutting down Darwin Streaming Server[darwinssd]: "
killall $darwinssd
RETVAL=$?
echo
rm -f /var/run/darwinssd
rm -f /var/run/darwinssd.pid
;;
status)
status $darwinssd
;;
restart)
$0 stop
$0 start
;;
reload)
echo -n "Reloading darwinssd: "
killall -HUP $darwinssd
echo
;;
*)
echo "Usage: $0 {start|stop|restart|reload|status}"
exit 1

esac

exit 0

