Icecast Streaming Media Server Forum Index Icecast Streaming Media Server
Icecast is a Xiph Foundation Project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Icec 0.4 / Icecast Debian startup script

 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Source Clients
View previous topic :: View next topic  
Author Message
Anonymous
Guest





PostPosted: Wed Apr 18, 2007 7:15 pm    Post subject: Icec 0.4 / Icecast Debian startup script Reply with quote

Code:

#! /bin/sh
#
# icecast2
#
#      Written by Miquel van Smoorenburg <miquels@cistron.nl>.
#      Modified for Debian
#      by Ian Murdock <imurdock@gnu.ai.mit.edu>.
#
#      Further modified by Keegan Quinn <ice@thebasement.org>
#      Further modified by William Galway <wgalway@gmail.com>
#      for use with Icecast 2 and Ices 0.4
#

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/bin/icecast
DAEMONICES=/usr/local/bin/ices
PIDFILEICES=/usr/local/var/log/icecast/ices.pid
NAME=icecast
NAMEICES=ices
DESC="icecast 2.3.1 and Ices 0.4"

test -x $DAEMON || exit 0

# Defaults
CONFIGFILE="/usr/local/etc/icecast.xml"
CONFIGFILEICES="/usr/local/etc/ices.conf"
CONFIGDEFAULTFILE="/etc/default/icecast2"
USERID=mpd
GROUPID=mpd
ENABLE="true"

# Reads config file (will override defaults above)
#[ -r "$CONFIGDEFAULTFILE" ] && . $CONFIGDEFAULTFILE

if [ "$ENABLE" != "true" ]; then
   echo "$NAME daemon disabled - read $CONFIGDEFAULTFILE."
   exit 0
fi

set -e

case "$1" in
  start)
   echo -n "Starting $DESC: "
        if start-stop-daemon --quiet --stop --signal 0 --exec $DAEMON
   then
      echo "[already running]"
   else
   start-stop-daemon --start --quiet --chuid $USERID:$GROUPID \
      --background --exec $DAEMON -- -c $CONFIGFILE
   sleep 5
   start-stop-daemon --start --quiet --chuid $USERID:$GROUPID \
      --pidfile $PIDFILEICES --exec $DAEMONICES -- -c $CONFIGFILEICES
   echo "$NAME $NAMEICES."
   fi
   ;;
  stop)
   echo -n "Stopping $DESC: "
   if start-stop-daemon --quiet --stop --signal 0 --exec $DAEMON
   then
   start-stop-daemon --stop --oknodo --quiet --exec $DAEMONICES
   start-stop-daemon --stop --oknodo --quiet --exec $DAEMON
   echo "."
   echo "$NAME $NAMEICES."
   else
      echo "[not running]";
   fi
   ;;
  reload|force-reload)
   echo "Reloading $DESC and Ices 0.4 configuration files."
   start-stop-daemon --stop --signal 1 --quiet --exec $DAEMON
   sleep 5
   start-stop-daemon --stop --signal 1 --quiet --exec $DAEMONICES
   ;;
  restart)
   echo -n "Restarting $DESC: "
   start-stop-daemon --stop --oknodo --quiet --exec $DAEMONICES
   sleep 2
   start-stop-daemon --stop --oknodo --quiet --exec $DAEMON
   sleep 5
   start-stop-daemon --start --quiet --chuid $USERID:$GROUPID \
      --background --exec $DAEMON -- -c $CONFIGFILE
   sleep 5
   start-stop-daemon --start --quiet --chuid $USERID:$GROUPID \
      --pidfile $PIDFILEICES --exec $DAEMONICES -- -c $CONFIGFILEICES
   ;;
  *)
   echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
   exit 1
   ;;
esac

exit 0
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Source Clients All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
subRebel style by ktauber