Sophie

Sophie

distrib > Mageia > 2 > i586 > by-pkgid > 5b201679ea02905d46454fedc2e9ff21 > files > 4

icecast-2.3.2-3.1.mga2.src.rpm

#!/bin/sh
#
# chkconfig: 345 35 65
# description: Streaming Media Server
#
### BEGIN INIT INFO
# Provides: icecast
# Required-Start: $network
# Required-Stop: $network
# Should-Start: ices
# Should-Stop: ices
# Default-Start: 3 4 5
# Short-Description: Streaming Media Server
# Description: Streaming Media Server.
### END INIT INFO

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

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

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

NAME=icecast
BINARY=icecast
PROCESS=icecast
LOCKFILE=/var/lock/subsys/icecast
RETVAL=0

start() {
	export TMPDIR="/var/tmp"
	echo -n "Starting $NAME: "
	daemon --user=icecast $BINARY -b -c /etc/icecast.xml
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && touch $LOCKFILE
}	
stop() {
	echo -n "Shutting down $NAME: "
	killproc $PROCESS
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && rm -f $LOCKFILE
}	

reload() {
	export TMPDIR="/var/tmp"
        echo -n "Reloading $NAME: "
	killproc $PROCESS -HUP
	RETVAL=$?
	echo
}

case "$1" in
  start)
  	start
	;;
  stop)
  	stop
	;;
  restart)
	stop
	start
	;;
  reload)
  	reload
	;;
  status)
	status $PROCESS
	RETVAL=$?
	;;
  condrestart)
  	[ -f $LOCKFILE ] && restart
	;;
  *)
	echo "Usage: $0 {start|stop|restart|status|condrestart}"
	RETVAL=1
esac

exit $?