Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37641529
en ru br
ALT Linux repos
S:2.4.4-alt2
5.0: 2.3.2-alt2.M50.1
4.1: 2.3.1-alt3
4.0: 2.3.1-alt3
3.0: 2.2.0-alt1

Group :: System/Servers
RPM: icecast

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

#!/bin/sh
#
# icecast: Starts the Icecast media streamer
#
# chkconfig: 2345 90 10
# description: Starts and stops the Icecast media streamer at boot time and shutdown.
#
# processname: icecast
# config: /etc/icecast/icecast.conf
# hide: true
### BEGIN INIT INFO
# Provides: icecast
# Required-Start: $local_fs $network $remote_fs
# Required-Stop: $local_fs $network $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start and stop Icecast
# Description: Icecast is an Internet based broadcasting system
# based on the Mpeg Layer III streaming technology.
# It is, however, not limited to streaming mp3 files.
### END INIT INFO

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

CONFFILE=/etc/icecast.xml
PIDFILE=/var/run/icecast/icecast.pid
LOCKFILE=/var/lock/subsys/icecast
RETVAL=0

#===== adjust chroot environment ======
adjust()
{
if [ -f "$CONFFILE" ] && grep -q '<chroot>1</chroot>' "$CONFFILE"; then
action "Adjusting environment for icecast:" /etc/chroot.d/icecast.all || exit
fi
}

start()
{
adjust
echo -n "Starting Icecast media streamer: "
start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user icecast -- icecast -b -c "$CONFFILE"
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch "$LOCKFILE"
return $RETVAL
}

stop()
{
echo -n "Shutting down Icecast media streamer: "
stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user icecast -- icecast

RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f "$LOCKFILE"
return $RETVAL
}

restart()
{
stop
start
}

reload()
{
adjust
echo -n "Reloading Icecast media streamer configuration: "
stop_daemon --pidfile "$PIDFILE" --expect-user icecast -HUP icecast
RETVAL=$?
echo
return $RETVAL
}

# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status icecast
RETVAL=$?
;;
reload)
reload
;;
restart)
restart
;;
condstop)
if [ -e "$LOCKFILE" ]; then
stop
fi
;;
condrestart)
if [ -e "$LOCKFILE" ]; then
restart
fi
;;
*)
echo "Usage: ${0##*/} {start|stop|status|reload|restart|condstop|condrestart}"
RETVAL=1
esac

exit $RETVAL
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin