View Full Version : Auto restarting Shoutcast 1.9.8

04-06-2012, 03:42 PM
Been having a problem where Apache is restarting at 4am every day, which I haven't got to the bottom of, and I'm not really bothered about since it's starting up again fine. However, as my web interface starts sc_serv under the users account, the apache restart is also killing off any processes owned by that user (And I don't want to have to be up at 4am to restart Shoutcast.

There were no particular scripts around that would fit the bill (that were easily found on google), so I've cobbled one together that I thought I'd share.

PROCESS=`netstat -tulpn | grep :$PORT`
if [ "$PROCESS" = "" ]
# Not found - start process
./sc_serv 8000.conf &
echo "Shoutcast on port $PORT started at $(date)" >>/home/results.txt
# Found it - don't do anything
echo ""

If you don't know what to do with the script, or how to get it to run automatically check out my full post http://monkeypigs.com/blog/auto-restarting-shoutcast-1-9-8/