View Single Post
Old 19th February 2009, 01:25   #5
dopelabs
Major Dude
 
dopelabs's Avatar
 
Join Date: Oct 2006
Location: Silicon Valley
Posts: 534
Send a message via AIM to dopelabs
the following will start up services on boot, and will restart if it fails or crashes. ive tested this on freebsd 6 and 7, centos, macosx

a script that checks to see if the sc_serv is running, if it isnt, start it.

Create a file. name it whatever.. i call mine sc_mon.sh

put the following in it:
code:

#!/bin/sh
#!/usr/bin/perl



### Shoutcast (SC_SERV)


## SC_SERV Server 1
if
( ! ps auxwww | grep "/home/user/sc_serv/sc_serv /home/user/sc_serv/sc_serv.conf" | grep -v grep )
then echo "Shoutcast not running..."
/home/user/sc_serv/sc_serv /home/user/sc_serv/sc_serv.conf &
fi


save and close the file

chmod 777 sc_mon.sh

setup a cron job to run this script every 60 secs... mine looks like this:

*/1 * * * * /home/user/sc_serv/sc_mon.sh >> /dev/null 2>&1

this will execute the script every 60 secs to check if shoutcast is running and will start it if its not.

cheers

DopeLabs
dopelabs is offline   Reply With Quote