shoutcast: #!/bin/sh # This is a way to not have to first find the process ID of the shoutcast services, # then remember what is listed below in CAPITOL letters versus its function usage() { echo echo "shoutcast accepts the following options:" echo " s)tart: start sc_trans amd sc_serv." echo " f)lush HUP: flush logfiles (close and reopen) -- will make console logging stop." echo " n)ext WINCH: jump to next song." echo " r)eload USR1: reload playlist off disk (will not interrupt current playing stream)." echo " s(h)uffle USR2: toggle shuffle on/off." echo " s(t)op TERM: normal sc_trans shutdown (clean)." echo " k)ill: clean shutdown of both sc_trans amd sc_serv." echo " c)lear: clear out the log files in /var/log/shout/." echo " p)rocess: list the process information for sc_trans amd sc_serv." echo } if [ ! -z "$1" ]; then case $1 in start | s) cd /home/jhuyett/stream/shoutcast/ ./sc_serv & cd /home/jhuyett/stream/trans/ ./sc_trans_linux ;; HUP | flush | f) pkill -HUP sc_trans ;; WINCH | next | n) pkill -WINCH sc_trans echo "Skipping to next song..." ;; USR1 | reload | r) pkill -USR1 sc_trans echo "Reloading playlist..." ;; USR2 | shuffle | h) pkill -USR2 sc_trans ;; TERM | stop | t) pkill sc_serv ;; kill | k) pkill sc_serv pkill -TERM sc_trans ;; clear | c) echo "" > /var/log/shout/sc_serv.log echo "" > /var/log/shout/sc_trans.log echo "" > /var/log/shout/sc_w3c.log echo "Log files have been cleared." ;; process | P) ps -ef | grep sc_ | grep -v grep ;; *) usage ;; esac else usage fi create.playlist: #!/bin/sh # create a playlist giving a directory location with or without a fillename usage() { echo echo "Usage: create [OPTION] [DIRECTORY]" echo " -f specify filename" echo " -h help" echo } if [ ! -z "$1" ]; then case $1 in -f) if [ ! -z "$3" ]; then find "$3" -name "*.mp3" -print > "$2" if [ $? -eq 1 ]; then echo "Could not create $2 from the directory specified as $3." fi else usage fi ;; *) if [ ! -z "$1" ]; then find "$1" -name "*.mp3" -print > playlist.txt if [ $? -eq 1 ]; then echo "Could not create playlist.txt from the directory specified as $1." fi else usage fi ;; esac else usage fi