#!/bin/sh # Nick Van Helleputte did the original # Colors and *mplayer check by houghi # Version 0.2 # Just comment the program you do NOT want # to use and uncomment the one you # do want to use on the line below #RADIO=xmms RADIO=mplayer # RADIO=any_other_program # That is all clear bold=`tput bold;tput setaf 4` offbold=`tput sgr0` red=`tput setaf 1` green=`tput setaf 2` yellow=`tput setaf 3` blue=`tput setaf 4` purlple=`tput setaf 5` cyan=`tput setaf 6` white=`tput setaf 7` #checking if gmplayer or mplayer is runnning for PROG in gmplayer mplayer xmms $RADIO do if ps f -C $PROG |grep $PROG >> /dev/null then echo ${bold}$PROG${offbold} "is running. Do you want to close it? ${bold}(Y/N)${offbold}" read key case "$key" in [y:Y] ) killall $PROG clear;; * ) clear echo "OK. It could be that you get ${red}no sound${offbold} now";; esac fi done ## Here we go: if [ "$1" == "" ]; then echo "${bold}Which station would you like to hear?${offbold} ${red}High Quality${offbold} ${yellow}Medium Quality${offbold} ${green}Low Quality${offbold} ${bold}1${offbold} Radio 1 ${bold}1m${offbold} Radio 1 ${bold}1l${offbold} Radio 1 ${bold}2${offbold} Radio 2 ${bold}2m${offbold} Radio 2 ${bold}2l${offbold} Radio 2 ${bold}3${offbold} StuBru ${bold}3m${offbold} StuBru ${bold}3l${offbold} StuBru ${bold}4${offbold} Donna ${bold}4m${offbold} Donna ${bold}4l${offbold} Donna ${bold}5${offbold} 4FM ${bold}5l${offbold} 4FM ${bold}6${offbold} QMusic ${bold}6l${offbold} QMusic ${bold}7${offbold} Topradio ${bold}7l${offbold} Topradio ${bold}8${offbold} Klara ${bold}8m${offbold} Klara ${bold}8l${offbold} Klara Type the number of your choice now (or give it as an argument to the script): " read keuze else keuze="$1" fi case "$keuze" in 1) station="http://mp3.streampower.be/radio1-high.mp3" ;; 1m) station="http://mp3.streampower.be/radio1-mid.mp3" ;; 1l) station="http://mp3.streampower.be/radio1-low.mp3" ;; 2) station="http://mp3.streampower.be/ra2vlb-high.mp3" ;; 2m) station="http://mp3.streampower.be/ra2vlb-mid.mp3" ;; 2l) station="http://mp3.streampower.be/ra2vlb-low.mp3" ;; 3) station="http://mp3.streampower.be/stubru-high.mp3" ;; 3m) station="http://mp3.streampower.be/stubru-mid.mp3" ;; 3l) station="http://mp3.streampower.be/stubru-low.mp3" ;; 4) station="http://mp3.streampower.be/donna-high.mp3" ;; 4m) station="http://mp3.streampower.be/donna-mid.mp3" ;; 4l) station="http://mp3.streampower.be/donna-low.mp3" ;; 5) station="mms://mss.streampower.be/4fmhi" ;; 5l) station="mms://mss.streampower.be/4fmlo" ;; 6) station="mms://mss.streampower.be/qmusic_ahi" ;; 6l) station="mms://mss.streampower.be/qmusic_alo" ;; 7) station="mms://broadcast.ionip.be/topradioHigh" ;; 7l) station="mms://broadcast.ionip.be/topradioLow" ;; 8) station="http://mp3.streampower.be/klara-high.mp3" ;; 8m) station="http://mp3.streampower.be/klara-mid.mp3" ;; 8l) station="http://mp3.streampower.be/klara-low.mp3" ;; *) echo "Wrong choice!" exit esac if [[ $RADIO = "mplayer" ]] then mplayer $station > /dev/null 2>&1 & else xmms $station & fi echo "Just be patient. The music is coming." exit