diff options
Diffstat (limited to 'streams')
-rw-r--r-- | streams/stream.db | 1 | ||||
-rwxr-xr-x | streams/streams | 13 |
2 files changed, 12 insertions, 2 deletions
diff --git a/streams/stream.db b/streams/stream.db index 5efeb9ea..47ccf7b5 100644 --- a/streams/stream.db +++ b/streams/stream.db @@ -6,3 +6,4 @@ http://somafm.com/illstreet.pls illstreet http://localhost:8000/stream.ogg icecast http://stream2.jungletrain.net:8000 jungletrain http://playlist.tormentedradio.com/tormentedradio.pls tormented +http://filebitch.shack:8000 mpd diff --git a/streams/streams b/streams/streams index 60a4bfc2..80c654ad 100755 --- a/streams/streams +++ b/streams/streams @@ -1,4 +1,8 @@ #! /bin/bash +set -euf + +stream_file=/tmp/krebs.stream.current + HERE=$(dirname $(readlink -f $0)) URLS=`cat $HERE/stream.db` CURRENT_STREAM="no stream" #will be set when calling `status` @@ -22,7 +26,12 @@ function start() { if echo "$URLS" | while read URL NAME; do if [ "$NAME" = "$REQ" ];then - tmux new-session -s streams -n streams -d "while sleep 1;do mplayer $URL;done" + tmux new-session -s streams -n streams -d " + while sleep 1; do + echo $NAME > $stream_file + mplayer $URL + done + " echo "** $REQ started" exit 1 fi @@ -97,7 +106,7 @@ Examples: case "$1" in start) - start $2 + start ${2-"`test -f $stream_file && cat $stream_file`"} ;; stop) stop |