fixed issue with 60-second RECORDING_LENGTH integer check

This commit is contained in:
Patrick McGuire
2021-10-04 10:52:27 -04:00
parent 1c4015c507
commit 70fd020eb4
2 changed files with 10 additions and 5 deletions
+2 -2
View File
@@ -82,10 +82,10 @@ run_analysis() {
[ -z $FILE_LENGTH ] && sleep 3 && continue
echo "RECORDING_LENGTH set to ${RECORDING_LENGTH}"
a=1
if [ ${RECORDING_LENGTH} == "01:00" ];then
if [ "${RECORDING_LENGTH}" == "01:00" ];then
until [ "$(ffmpeg -i ${1}/${i} 2>&1 | awk -F. '/Duration/ {print $1}' | cut -d':' -f3-4)" == "${RECORDING_LENGTH}" ];do
sleep 1
[ $a -ge ${RECORDING_LENGTH} ] && sudo rm -f ${1}/${i} && break
[ $a -ge 60 ] && sudo rm -f ${1}/${i} && break
a=$((a+1))
done
else
+8 -3
View File
@@ -34,11 +34,16 @@ echo " -$SOFAR species identified so far"
echo
if [ ${a} -ge 1 ];then
while 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}
fi
echo
echo -n "Listening since "${INSTALL_DATE}""
sleep 180
sleep 20
clear
done