From 077c099cd76e16568c795d01b7d9ab7d822b9022 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Thu, 18 Jul 2024 23:11:07 +0200 Subject: [PATCH] Update 30-monitoring.sh --- birdnet-pi/rootfs/custom-services.d/30-monitoring.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/birdnet-pi/rootfs/custom-services.d/30-monitoring.sh b/birdnet-pi/rootfs/custom-services.d/30-monitoring.sh index 8e3676308..4364481fb 100755 --- a/birdnet-pi/rootfs/custom-services.d/30-monitoring.sh +++ b/birdnet-pi/rootfs/custom-services.d/30-monitoring.sh @@ -77,13 +77,15 @@ while true; do bashio::log.green "$(date) INFO ${wavs} wav files waiting in $ingest_dir, $srv state is $state" - if ((wavs > 100)) && [[ "$state" == "active" ]]; then + if ((wavs > 100)); then + bashio::log.red "$(date) WARNING too many files in queue, pausing $srv" sudo systemctl stop "$srv" - bashio::log.red "$(date) WARNING stopped $srv service" + sudo systemctl restart birdnet_analysis if [ -s "$HOME/BirdNET-Pi/apprise.txt" ]; then apprisealert; fi - elif ((wavs <= 100)) && [[ "$state" != "active" ]]; then - sudo systemctl start $srv + elif [[ "$state" != "active" ]]; then bashio::log.yellow "$(date) INFO started $srv service" + sudo systemctl start $srv + sudo systemctl restart birdnet_analysis fi ((counter--))