A live bird collage card for your Home Assistant dashboard.
fixed issue with 60-second RECORDING_LENGTH integer check
Patrick McGuire70fd020eb475
diff --git a/scripts/birdnet_analysis.sh b/scripts/birdnet_analysis.shindex 72a8a378..048f77f0 100755--- a/scripts/birdnet_analysis.sh+++ b/scripts/birdnet_analysis.sh@@ -82,10 +82,10 @@ run_analysis() {[ -z $FILE_LENGTH ] && sleep 3 && continueecho "RECORDING_LENGTH set to ${RECORDING_LENGTH}"a=1- if [ ${RECORDING_LENGTH} == "01:00" ];then+ if [ "${RECORDING_LENGTH}" == "01:00" ];thenuntil [ "$(ffmpeg -i ${1}/${i} 2>&1 | awk -F. '/Duration/ {print $1}' | cut -d':' -f3-4)" == "${RECORDING_LENGTH}" ];dosleep 1- [ $a -ge ${RECORDING_LENGTH} ] && sudo rm -f ${1}/${i} && break+ [ $a -ge 60 ] && sudo rm -f ${1}/${i} && breaka=$((a+1))doneelsediff --git a/scripts/birdnet_stats.sh b/scripts/birdnet_stats.shindex 28737dc1..c6665973 100755--- a/scripts/birdnet_stats.sh+++ b/scripts/birdnet_stats.sh@@ -34,11 +34,16 @@ echo " -$SOFAR species identified so far"echoif [ ${a} -ge 1 ];thenwhile read -r line;do- echo " | $line"-done < <(awk -v n=2 '1; NR % n == 0 {print ""}' ${IDFILE})+ SPECIES="$(echo "${line}" | awk -F: '/Common Name/ {print $2}')"+ SPECIES=${SPECIES// /_}+ SPECIES=${SPECIES/_}+ [ -z ${SPECIES} ] && continue+ DETECTIONS="$(ls -1 ${EXTRACTED}/By_Date/*/${SPECIES}| wc -l)"+ echo -e " | $line # of detections so far: ${DETECTIONS}\n"+done < ${IDFILE}fiechoecho -n "Listening since "${INSTALL_DATE}""-sleep 180+sleep 20cleardone