View Single Post
Old 11th February 2009, 19:51   #3
caraoge
Senior Member
 
caraoge's Avatar
 
Join Date: Dec 2003
Location: Saarland, Germany
Posts: 331
Step 1:
Create a file named "shoutcast" with the following content in "/etc/init.d/" or
download the attached file, rename, modify and copy it to "/etc/init.d/" (Full path "/etc/init.d/shoutcast"):

code:
#!/bin/sh
#
# Sample init script for SHOUTcast
# by caraoge
#

# Check for SHOUTcast binary
test -f /caraoge/sc_serv || exit 0

# The init commands
case "$1" in
start)
echo "Starting SHOUTcast server..."
/caraoge/sc_serv /caraoge/sc_serv.conf &
;;
stop)
echo "Stopping SHOUTcast server..."
kill -9 `ps -C sc_serv -o pid --no-headers`
;;
restart)
echo "Stopping SHOUTcast server..."
kill -9 `ps -C sc_serv -o pid --no-headers`
echo "Starting SHOUTcast server..."
/caraoge/sc_serv /caraoge/sc_serv.conf &
;;
*)
echo "usage: /etc/init.d/shoutcast"
echo "$0 {start | stop | restart}"
exit 1
;;
esac


Note: You have to edit the path to your SHOUTcast binary and your configuration file


Step 2:
Now you have to make the file executable:
code:
chmod 755 /etc/init.d/shoutcast


Step 3:
Create the startup scripts with (Debian!):
code:
update-rc.d shoutcast defaults


Step 4:
Now your SHOUTcast server starts up everytime your server pass through its startup sequence.
If your server is running, you can use
code:
/etc/init.d/shoutcast start

or
code:
/etc/init.d/shoutcast stop

or
code:
/etc/init.d/shoutcast restart

to control your SHOUTcast server.

Removing the SHOUTcast server from the startup sequence:
Type this on your command line:
code:
update-rc.d -f shoutcast remove
Attached Files
File Type: txt shoutcast.txt (921 Bytes, 1305 views)
caraoge is offline   Reply With Quote