Skip to content

Instantly share code, notes, and snippets.

@cristianobecker
Last active January 14, 2016 16:00
Show Gist options
  • Save cristianobecker/8921dacf616f1bcf022a to your computer and use it in GitHub Desktop.
Save cristianobecker/8921dacf616f1bcf022a to your computer and use it in GitHub Desktop.
Internet radio to work
radio() {
local radio
local station
local playlist
if test $# -eq 2; then
radio="$1"
station="$2"
elif test $# -eq 0; then
radio=soma
station=groovesalad
else
echo "Usage: radio [radio station]"
fi
case $radio in
soma) playlist="http://somafm.com/$station.pls" ;;
difm) playlist="http://listen.di.fm/public3/$station.pls" ;;
*) echo "radio not available"
esac
test $playlist && mplayer -vo none -playlist "$playlist"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment