Skip to content

A live bird collage card for your Home Assistant dashboard.

USER exported to createdb.sh

mcguirepr899319b1b55c29
diff --git a/scripts/createdb.sh b/scripts/createdb.sh
index 2ea002f4..920fe235 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 e09d667a..891ef914 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