From 9319b1b55c29bebae4f26c351fca4de9e59780a6 Mon Sep 17 00:00:00 2001 From: mcguirepr89 Date: Mon, 11 Apr 2022 12:33:00 -0400 Subject: [PATCH] USER exported to createdb.sh --- scripts/createdb.sh | 4 ++-- scripts/install_services.sh | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/createdb.sh b/scripts/createdb.sh index 2ea002f..920fe23 100755 --- a/scripts/createdb.sh +++ b/scripts/createdb.sh @@ -16,5 +16,5 @@ CREATE TABLE IF NOT EXISTS detections ( Overlap FLOAT, File_Name VARCHAR(100) NOT NULL); EOF -sudo chown $USER:$USER $HOME/BirdNET-Pi/scripts/birds.db -sudo chmod g+w $HOME/BirdNET-Pi/scripts/birds.db +chown $USER:$USER $HOME/BirdNET-Pi/scripts/birds.db +chmod g+w $HOME/BirdNET-Pi/scripts/birds.db diff --git a/scripts/install_services.sh b/scripts/install_services.sh index e09d667..891ef91 100755 --- a/scripts/install_services.sh +++ b/scripts/install_services.sh @@ -4,7 +4,10 @@ set -x # Uncomment to enable debugging trap 'rm -f ${tmpfile}' EXIT trap 'exit 1' SIGINT SIGHUP tmpfile=$(mktemp) + config_file=$my_dir/birdnet.conf +export USER=$USER +export HOME=$HOME install_depends() { curl -1sLf \ @@ -441,7 +444,7 @@ install_services() { generate_BirdDB configure_caddy_php config_icecast - ${my_dir}/scripts/createdb.sh + USER=$USER HOME=$HOME ${my_dir}/scripts/createdb.sh } if [ -f ${config_file} ];then