From b0676c821755379455bcf4ec1b45417290bb80fd Mon Sep 17 00:00:00 2001 From: ehpersonal38 <103586016+ehpersonal38@users.noreply.github.com> Date: Fri, 17 Feb 2023 12:03:49 -0500 Subject: [PATCH] possible workaround for notorious bug --- scripts/birdnet_analysis.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/birdnet_analysis.sh b/scripts/birdnet_analysis.sh index edf8100..4d55f99 100755 --- a/scripts/birdnet_analysis.sh +++ b/scripts/birdnet_analysis.sh @@ -100,7 +100,13 @@ run_analysis() { echo "${1}/${i}" > $HOME/BirdNET-Pi/analyzing_now.txt [ -z ${RECORDING_LENGTH} ] && RECORDING_LENGTH=15 echo "RECORDING_LENGTH set to ${RECORDING_LENGTH}" + itr=0 until [ -z "$(lsof -t ${1}/${i})" ];do + itr=$((itr+1)) + if [ $itr -eq 30 ]; then + echo "Maximum number of attempts exceeded. Exiting & restarting service." + exit + fi sleep 2 done