-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathradio.sh
84 lines (76 loc) · 1.24 KB
/
radio.sh
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash
LIST=0
exit0 () {
exit 0
}
play () {
PLAY=$(cat ./radio.txt|grep -w $LIST|awk '{print $2}')
if [[ "" != $PLAY ]]
then
mplayer $PLAY
else
exit0
fi
}
play_ch () {
PLAY=$(cat ./radio.txt|grep -w $LIST_CH|awk '{print $2}')
if [[ "" != $PLAY ]]
then
mplayer $PLAY
else
exit0
fi
}
while true
do
LIST=$(($LIST+1))
case $CH in
false)
;;
* )
play
;;
esac
read -n 1 INPUT
case $INPUT in
q|Q)
exit0
;;
1)
unset LIST
LIST_CH=1
CH=false
play_ch
;;
2)
unset LIST
LIST_CH=2
CH=false
play_ch
;;
3)
unset LIST
LIST_CH=3
CH=false
play_ch
;;
4)
unset LIST
LIST_CH=4
CH=false
play_ch
;;
0)
unset CH
;;
* )
;;
esac
#mplayer $PLAY
if [[ "" != $PLAY ]]
then
true
else
exit0
fi
done