Manage SHOUTcast Server and Create Daemon scriptThe command used to manage SHOUTcast radio server is the binary file itself, which must be run from its installation path location in order to be
able to read configuration file. To run the server as a daemon use daemon command option.
You can also instruct the server to read its configurations from a different location by indicating where the configuration file resides, but be advised
that using this option requires the creation of logs and control directories, which can be confusing in practice and can lead to server inability to start.
$ pwd ## Assure that you are in the right installation directory - /home/radio/server
$ ./sc_serv ## Start the server in foreground – Hit Ctrl + c to stop
$ ./sc_serv daemon ## Start the server as a daemon
$ Ps aux | grep sc_serv ## Get Server PID
$ killall sc_serv ## Stop server daemon
Shoutcast Start Script If you need a simplified command to start or stop SHOUTcast radio server, login as root again and create the following executable script on /usr/local/bin/ path as in the example below.
$ su -
# nano /usr/local/bin/radio
Now add the following excerpt to radio file.
#!/bin/bash
case $1 in
start)
cd /home/radio/server/
./sc_serv &
;;
stop)
killall sc_serv
;;
start_daemon)
cd /home/radio/server/
./sc_serv daemon
;;
*)
echo "Usage radio start|stop"
;;
esac
Shoutcast Binary Start ScriptAfter the file was created, make it executable, exit root account and a new command shout be available for your SHOUTcast radio server management.
# chmod +x /usr/local/bin/radio
# exit
To manage the server from now on, use radio command with the following switches.
$ radio start_daemon ## Starts SHOUTcast server as a daemon
$ radio start ## Starts SHOUTcast server in foreground
$ radio stop ## Stops SHOUTcast server
Start Stop ShoutcastIf you want to automatically start the server after reboot, but only on user login (in this case the server was installed on the local user named radio) issue the following command from radio account home path, then logout and login again to verify the functionality, as presented in the screenshot below.
$ whoami
$ echo “radio start_daemon” >> ~/.bashrc
Start Shoutcast at RebootThat’s it! Now, SHOUTcast server is ready to receive sound or playlists from remote media players such as Winamp from Windows and Mixxx from Linux and broadcast all of the received audio content over Internet.