#!/bin/sh
#
# icecast	This shell script takes care of starting and stopping
#		icecast.
#
# chkconfig: 345 96 24
# description: Icecast is an Internet based broadcasting system based on the Mpeg Layer III
#              streaming technology

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

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

# Check that icecast.conf exists.
[ -f /etc/icecast/icecast.conf ] || exit 0

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

exit 0
