some bugfixes

This commit is contained in:
Martin Selbmann 2020-09-22 20:39:17 +02:00
parent 0dd9b558af
commit e99922351e
1 changed files with 3 additions and 14 deletions

View File

@ -19,14 +19,8 @@ $cmdgpio write $strobogpio 1
$cmdgpio mode $swdowngpio in
$cmdgpio mode $swupgpio in
cmdonairstat=0
while true; do
if [ "$cmdonairstat" -eq 1 ]; then
cmdonairstat=0
fi
buzzerstat="$($cmdgpio read $buzzgpio)"
swupstat="$($cmdgpio read $swupgpio)"
@ -42,19 +36,14 @@ while true; do
$(command -v pkill) "$pgrepplayer"
fi
$(command -v $player) $playerparam --loop ~/RandomVideo/onair.mp4 &
while [ "$swupstat" -eq 1 ]; do
if [ "$cmdonairstat" -eq 0 ]; then
echo "on air"
cmdonairstat=1
fi
swupstat="$($cmdgpio read $swupgpio)"
sleep 0.1
done
echo "off air"
$(command -v pkill) "$pgrepplayer"
elif [ "$buzzerstat" -eq 1 ] && [ "$swupstat" -eq 0 ]; then
sleep 0.1