You were never here, you didn't see anything..

tunes.sh


I am now motivated to share a very simple script. This is what I use when I want to listen to my (current) favorite shoutcast station, I call it tunes.sh:

#!/bin/bash

# This is a simple script to start playing Chronix Radio
# (or something else) from the cli using mplayer.

function play() {
mplayer -ao alsa -msgcolor -msglevel global=0:network=0:afilter=0:decaudio=0:netst=2:statusline=6:identify=2:ds=2:stream=2:cplayer=3 $(curl -s $url | grep http | cut -d = -f 2)
}

case "$1" in
	aggression)
		url="http://www.chronixradio.com/stations/chronixaggression/listen/listen.pls"
		play
		;;
	grit)
		url="http://www.chronixradio.com/stations/cxrgrit/listen/listen.pls"
		play
		;;
	*)
		# This is a catch all for screwups
		echo "You forgot to specifiy a channel man..."
		;;
esac

Simply run “tunes.sh $station” to fire things up. For example to play the Grit station:
./tunes.sh grit

Have any Question or Comment?

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This blog is kept spam free by WP-SpamFree.

Most who fail…

Most who fail have yet to really try!