From f24c5923b0c25ff3c6286e69f958407e0076fe03 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Tue, 5 Oct 2021 11:56:51 -0400 Subject: [PATCH] changed birdnet_stats.sh and added security to --- scripts/birdnet_stats.sh | 14 ++++++++++++-- scripts/install_services.sh | 6 ++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/scripts/birdnet_stats.sh b/scripts/birdnet_stats.sh index c666597..809f1f7 100755 --- a/scripts/birdnet_stats.sh +++ b/scripts/birdnet_stats.sh @@ -28,7 +28,12 @@ if [ "${a}" -ge "1" ];then else SOFAR=0 fi -echo " -$a detections so far" +if [ $SOFAR = 1 ];then + verbage=detection +else + verbage=detections +fi +echo " -$a $verbage so far" echo echo " -$SOFAR species identified so far" echo @@ -39,7 +44,12 @@ while read -r line;do SPECIES=${SPECIES/_} [ -z ${SPECIES} ] && continue DETECTIONS="$(ls -1 ${EXTRACTED}/By_Date/*/${SPECIES}| wc -l)" - echo -e " | $line # of detections so far: ${DETECTIONS}\n" + if [ ${DETECTIONS} = 1 ];then + verbage=detection + else + verbage=detections + fi + echo -e "${DETECTIONS} $verbage for ${SPECIES//_/ }" | sort done < ${IDFILE} fi echo diff --git a/scripts/install_services.sh b/scripts/install_services.sh index 7400407..5406761 100755 --- a/scripts/install_services.sh +++ b/scripts/install_services.sh @@ -196,6 +196,9 @@ ${EXTRACTIONS_URL} { basicauth /Processed* { birdnet ${HASHWORD} } + basicauth /scripts* { + birdnet ${HASHWORD} + } basicauth /stream { birdnet ${HASHWORD} } @@ -209,6 +212,9 @@ http://birdnetsystem.local { basicauth /Processed* { birdnet ${HASHWORD} } + basicauth /scripts* { + birdnet ${HASHWORD} + } basicauth /stream { birdnet ${HASHWORD} }