Created
September 19, 2016 08:53
-
-
Save EarlGray/d64514459892650881353a465c4b9a05 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PLAYER=mplayer | |
PLAYER_OPTIONS=-prefer-ipv4 | |
while getopts "gch" opt; do | |
case $opt in | |
g) PLAYER=smplayer | |
export DISPLAY=:0 | |
;; | |
c) | |
PLAYER_OPTIONS="$PLAYER_OPTIONS -ao pcm:file=cap.wav" | |
;; | |
h) | |
echo "Usage: $0 <channel|*.m3u|*.pls>" | |
echo " channels are: roks|ahfm|difm|anty" | |
exit | |
;; | |
esac | |
done | |
shift $(($OPTIND-1)) | |
case $1 in | |
roks) STATION='http://online-radioroks.tavrmedia.ua:8000/RadioROKS' ;; | |
ahfm) STATION='http://ua.ah.fm:9010' ;; | |
difm) STATION='http://pub1.di.fm:80/di_trance' ;; | |
anty) STATION='http://ant-waw-01.cdn.eurozet.pl:8602/' ;; | |
*.m3u) STATION="`cat $1 | egrep -v '^#|^$'`" ;; | |
*.pls) STATION="`grep File1 "$1" | sed 's/File1=//'`" ;; | |
*) echo "Unknown station: $1" | |
exit 1 | |
;; | |
esac | |
exec $PLAYER $PLAYER_OPTIONS $STATION |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment