Jump to content

Auto restarting Shoutcast 1.9.8


techmonkey
 Share

Recommended Posts

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.

 

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

 

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/

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...