diff --git a/buzzer.sh b/buzzer.sh index 92c7d1b..6608aa9 100755 --- a/buzzer.sh +++ b/buzzer.sh @@ -22,7 +22,12 @@ $cmdgpio mode $swupgpio in cmdonairstat=0 while true; do - + + if [ "cmdonairstat" -eq 1 ]; then + $(command -v pkill) "$pgrepplayer" + cmdonairstat=0 + fi + buzzerstat="$($cmdgpio read $buzzgpio)" swupstat="$($cmdgpio read $swupgpio)" @@ -50,9 +55,6 @@ while true; do sleep 0.1 done - $(command -v pkill) "$pgrepplayer" - cmdonairstat=0 - elif [ "$buzzerstat" -eq 1 ] && [ "$swupstat" -eq 0 ]; then sleep 0.1