-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmp3script.sh
executable file
·35 lines (26 loc) · 1.11 KB
/
mp3script.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
#!/bin/sh
#tail the file you want to watch
tail -fn0 /tmp/cid.log | while read line ; do
echo "$line" | grep 'kaart gevonden' | grep -v 'things to block the reaction'
if [ $? = 0 ]
then
# do things
#echo "just saw $line"
#mpg123 4.mp3
echo "$line" | grep '04D98B02CF3980' | grep -v 'things to block the reaction'
if [ $? = 0 ]
then
mpg123 /home/pi/bidding.mp3
ifconfig eth0 | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}' | festival --tts
else
echo "$line" | grep '040D4F9AFF2080' | grep -v 'things to block the reaction'
if [ $? = 0 ]
then
mpg123 /home/pi/helpwill.mp3
else
mpg123 $(for i in sounds/*; do echo "$i"; done | shuf -n1)
#mpg123 /home/pi/sounds/$[ 1 + $[ RANDOM % 13]].mp3
fi
fi
fi
done