From 0ec02a2239dcab4b5590b2c3fc092a8a2ed887fe Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Mon, 31 Jan 2022 16:35:57 -0500 Subject: [PATCH] fixing some missing symlinks and file permissions --- scripts/birdnet_analysis.sh | 10 ++++++++-- scripts/clear_all_data.sh | 1 + scripts/install_services.sh | 1 + scripts/update_services.sh | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/birdnet_analysis.sh b/scripts/birdnet_analysis.sh index 9bda1af..ebb14fc 100755 --- a/scripts/birdnet_analysis.sh +++ b/scripts/birdnet_analysis.sh @@ -29,8 +29,14 @@ fi INCLUDE_LIST="/home/pi/BirdNET-Pi/include_species_list.txt" EXCLUDE_LIST="/home/pi/BirdNET-Pi/exclude_species_list.txt" -[ -f ${INCLUDE_LIST} ] || touch ${INCLUDE_LIST} -[ -f ${EXCLUDE_LIST} ] || touch ${EXCLUDE_LIST} +if [ -f ${INCLUDE_LIST} ];then + touch ${INCLUDE_LIST} && + sudo chmod g+rw ${INCLUDE_LIST} +fi +if [ -f ${EXCLUDE_LIST} ];then + touch ${EXCLUDE_LIST} && + sudo chmod g+rw ${EXCLUDE_LIST} +fi if [ "$(du ${INCLUDE_LIST} | awk '{print $1}')" -lt 4 ];then INCLUDE_LIST=null fi diff --git a/scripts/clear_all_data.sh b/scripts/clear_all_data.sh index 54c4034..8237c7d 100755 --- a/scripts/clear_all_data.sh +++ b/scripts/clear_all_data.sh @@ -39,6 +39,7 @@ if [ ! -z ${EXTRACTIONLOG_URL} ];then done fi +sudo -u ${USER} ln -fs $(dirname ${my_dir})/model/labels.txt ${my_dir}/ sudo -u ${USER} ln -fs $(dirname ${my_dir})/scripts ${EXTRACTED} if [ -z ${BIRDNETPI_URL} ];then sudo -u${USER} sed -i "s/birdnetpi.local/$(hostname).local/g" $(dirname ${my_dir})/homepage/*.html diff --git a/scripts/install_services.sh b/scripts/install_services.sh index 8020730..6eed9ae 100755 --- a/scripts/install_services.sh +++ b/scripts/install_services.sh @@ -142,6 +142,7 @@ create_necessary_dirs() { done fi + sudo -u ${USER} ln -fs $(dirname ${my_dir})/model/labels.txt ${my_dir}/ sudo -u ${USER} ln -fs $(dirname ${my_dir})/scripts ${EXTRACTED} if [ -z ${BIRDNETPI_URL} ];then sudo -u${USER} sed -i "s/birdnetpi.local/$(hostname).local/g" $(dirname ${my_dir})/homepage/*.html diff --git a/scripts/update_services.sh b/scripts/update_services.sh index 9d88b37..9fad482 100755 --- a/scripts/update_services.sh +++ b/scripts/update_services.sh @@ -130,6 +130,7 @@ create_necessary_dirs() { done fi + sudo -u ${USER} ln -fs $(dirname ${my_dir})/model/labels.txt ${my_dir}/ sudo -u ${USER} ln -fs $(dirname ${my_dir})/scripts ${EXTRACTED} if [ -z ${BIRDNETPI_URL} ];then sudo -u${USER} sed -i "s/birdnetpi.local/$(hostname).local/g" $(dirname ${my_dir})/homepage/*.html