1 changed files with 27 additions and 0 deletions
@ -0,0 +1,27 @@
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh |
||||
|
||||
#Сценарий прослушивания радиостанций |
||||
#Формат списка: name;playlist |
||||
|
||||
STATIONS=$SHELLRC/etc/soft/radio/stations |
||||
|
||||
plays() { |
||||
echo $1 |
||||
PLAYLIST=$(cat $STATIONS | grep "$1" | cut -d ';' -f 2) |
||||
|
||||
echo $PLAYLIST | grep 'http' |
||||
|
||||
if [ $? -eq 0 ]; then |
||||
killall play 2>/dev/null |
||||
STREAM=$(curl -s $PLAYLIST | grep 'http://' | sed 's/^.*http/http/' | head -n 1) |
||||
curl -s $STREAM | play -q -t mp3 - |
||||
fi |
||||
} |
||||
|
||||
CH=$(cat $STATIONS | cut -d ';' -f 1 | dmenu -fn '-*-fixed-*-*-*-*-15-*-*-*-*-*-*-*' -l 10) |
||||
|
||||
case $CH in |
||||
STOP) killall play 2>/dev/null;; |
||||
*) plays "$CH";; |
||||
esac |
||||
|
Loading…
Reference in new issue