Skip to content

Commit

Permalink
Update 30-monitoring.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbelgium authored Jul 18, 2024
1 parent 7fb529f commit 077c099
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions birdnet-pi/rootfs/custom-services.d/30-monitoring.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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--))
Expand Down

0 comments on commit 077c099

Please sign in to comment.