[icecast] Re: keeping Liveice running...

Robin P. Blanchard Robin_Blanchard at gactr.uga.edu
Tue Oct 9 20:48:22 UTC 2001

ok...based on William's shoutcast-based suggestion, i've come up with
the following. i haven't had time to really test the thing
yet...suggestions are greatly appreciated.

i based this on the fact that icecast's stats.log tells what sources are
connected (in my case 0 and 1) and that log is updated frequently (per


SOURCE=`cat $LOG |grep Source\ [0-1] |awk '{print $1" "$2}'|sort |uniq`
PIDS=`ps ax |grep $DIR/bin/liveice |awk '{print $1}' ; ps ax |grep
$DIR/bin/lame |awk '{print $1}'`

if [ "$SOURCE" ] ; then
        echo "LiveIce still connected to icecast server."
        if [ "$PIDS" ] ; then 
                echo "Killing rogue processes..."
                echo "pid(s): $PIDS"
                kill -9 $PIDS
                $DIR/bin/liveice -F $DIR/etc/liveice/liveice.cfg
>/dev/null 2>/dev/null &
                echo "LiveIce restarted at `date`."
        $DIR/bin/liveice -F $DIR/etc/liveice/liveice.cfg >/dev/null
2>/dev/null &
        echo "LiveIce restarted at `date`."

Robin P. Blanchard
IT Program Specialist
Georgia Center for Continuing Ed.
fon: 706.542.2404 fax: 706.542.6546
email: Robin_Blanchard at gactr.uga.edu

--- >8 ----
List archives:  http://www.xiph.org/archives/
icecast project homepage: http://www.icecast.org/
To unsubscribe from this list, send a message to 'icecast-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.

More information about the Icecast mailing list