Sunucuda Shoutcast Otomatik Başlatma

Sunucuda Shoutcast Otomatik Başlatma

Öncelikle aşağıdaki komutları sırası ile yürütelim ;

cd /etc/init.d
nano shoutcast

Nano ile açtığımız dosyaya aşağıdaki bash scripti ekleyelim, kaydedip editörden çıkalım ;

#!/bin/sh
#
# chkconfig: 345 99 01
#
# description: shoutcast server startup script
#
# Init script for SHOUTcast
# by caraoge, modified to work correctly by Thomas R Bailey, modified further for
# use with three servers by Nathan Skelton
#
# Last edited Jan 13 2009
# Set config to config file location
# set daemon to sc_serv location
############################################################################
## CHANGE THESE VALUES to match your setup
## CONFIG is the fully qualified location of your config file
## DAEMON is the fully qualified location of the sc_serv binary
## Note, the script will look for sc_serv and sc_serv.conf in /home/shoutcast
############################################################################
DAEMON="/root/sc/sc_serv"
CONFIG="/root/sc/sc_serv.conf"
############# Don't fiddle below this line ##############
# Check for SHOUTcast binary
test -f $DAEMON || exit 0
# The init commands
case "$1" in
start)
echo "Basliyor SHOUTcast server..."
$DAEMON $CONFIG > /dev/null 2>&1 &
;;
stop)
echo "Durduruluyor SHOUTcast server..."
kill -9 `ps -C sc_serv -o pid --no-headers`
;;
restart)
echo "Durduruluyor SHOUTcast server..."
kill -9 `ps -C sc_serv -o pid --no-headers`
echo "Basliyor CliaWeb SHOUTcast server..."
$DAEMON $CONFIG > /dev/null 2>&1 &
;;
*)
echo "usage: /etc/init.d/shoutcast"
echo "$0 {start | stop | restart}"
exit 1
;;
esac

Aşağıdaki komutları sırası ile uygulayalım ;

chmod 0755 /etc/init.d/shoutcast
cd /etc/rc.d/rc5.d
ln -s ../init.d/shoutcast S99shoutcast
chkconfig --add shoutcast
chkconfig shoutcast on
/etc/init.d/shoutcast start

Sunucumuzu yeniden başlattığımızda Shoutcast Server ın otomatik başladığını göreceğiz ;

reboot