#!/bin/sh # # ices This shell script takes care of starting and stopping # ices. # # chkconfig: 345 96 24 # description: Icecast is an Internet audio broadcasting system based on # MPEG audio technology. Ices is a streamer for icecast. # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. if is_yes "${NETWORKING}"; then if [ ! -f /var/lock/subsys/network ]; then msg_network_down ices exit 1 fi else exit 0 fi # Check that ices.conf exists. [ -f /etc/icecast/ices.conf ] || (echo \ 'There are two config files: /etc/icecast/ices.conf.dist - default config (you must have XML support); /etc/icecast/ices.conf.txt - text config file made for PLD by jack@pld.org.pl After choosing one of them you have to configure it before run and rename to /etc/icecast/ices.conf. Enjoy! Your PLD Team'\ && exit 0) # See how we were called. case "$1" in start) # Check if the service is already running? if [ ! -f /var/lock/subsys/ices ]; then # Start daemons. msg_starting ices # daemon --user icecast -s /bin/sh 'ices' # Our daemon function doesn't include su's --shell function [ -f /etc/icecast/ices.conf ] && \ ICES_CONFIG=`file /etc/icecast/ices.conf|grep XML` if [ ${ICES_CONFIG} = "" ]; then su icecast -s /bin/sh -c 'ices -c /etc/icecast/ices.conf' else . /etc/icecast/ices.conf su icecast -s /bin/sh -c "ices ${ICES_OPTIONS}" fi ok touch /var/lock/subsys/ices else msg_already_running ices fi ;; stop) if [ ! -f /var/lock/subsys/ices ]; then # Stop daemons. msg_stopping ices killproc ices 2> /dev/null rm -f /var/lock/subsys/ices else msg_not_running ices fi ;; restart|force-reload) $0 stop $0 start exit $? ;; status) status ices exit $? ;; *) msg_usage "$0 {start|stop|restart|force-reload|status}" exit 3 esac exit 0