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