Update 30-monitoring.sh

This commit is contained in:
Alexandre
2024-07-18 23:11:07 +02:00
committed by GitHub
parent 7fb529f6d7
commit 077c099cd7

View File

@@ -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--))