summaryrefslogtreecommitdiffstats
path: root/modules/streams/radiotux
blob: 9d671493dd58043c2aa9b7fe4bb53f0a961a5cb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#! /bin/bash
set -euf
function stop()
{
  pkill mplayer || true
}

CMD="while true; do exec mplayer http://streams.xenim.de/radiotux.ogg; sleep 1;done"
case "$1" in
  start)
    stop
    if tmux list-sessions;
    then 
      tmux new-window "$CMD"  &
    else
      tmux new-session "$CMD" &
    fi
    ;;
  stop)
    stop
    ;;
  restart)
    stop
    start
    ;;
  *)
    echo "aidsballs"
  ;;
esac