diff --git a/scripts/clear_all_data.sh b/scripts/clear_all_data.sh index c26df1b..68e089d 100755 --- a/scripts/clear_all_data.sh +++ b/scripts/clear_all_data.sh @@ -24,7 +24,7 @@ echo "Creating necessary directories" sudo -u ${USER} ln -fs $(dirname ${my_dir})/homepage/* ${EXTRACTED} sudo -u ${USER} ln -fs $(dirname ${my_dir})/model/labels.txt ${my_dir}/ -sudo -u ${USER} ln -fs $(dirname ${my_dir})/scripts ${EXTRACTED} +sudo -u ${USER} ln -fs $(dirname ${my_dir}) ${EXTRACTED} sudo -u ${USER} ln -fs $(dirname ${my_dir})/scripts/play.php ${EXTRACTED} sudo -u ${USER} ln -fs $(dirname ${my_dir})/scripts/spectrogram.php ${EXTRACTED} sudo -u ${USER} ln -fs $(dirname ${my_dir})/scripts/overview.php ${EXTRACTED} @@ -37,10 +37,10 @@ sudo -u ${USER} ln -fs $(dirname ${my_dir})/templates/phpsysinfo.ini ${HOME}/php sudo -u ${USER} ln -fs $(dirname ${my_dir})/templates/green_bootstrap.css ${HOME}/phpsysinfo/templates/ sudo -u ${USER} ln -fs $(dirname ${my_dir})/templates/index_bootstrap.html ${HOME}/phpsysinfo/templates/html sudo chmod -R g+rw $(dirname ${my_dir}) -sudo chmod -R g+rw ${RECS_DIR} +sudo chmod -R g+rw ${EXTRACTED} echo "Dropping and re-creating database" -sudo /home/pi/BirdNET-Pi/scripts/createdb.sh +createdb.sh echo "Restarting services" sudo systemctl start birdnet_server.service sudo systemctl start birdnet_analysis.service diff --git a/scripts/createdb.sh b/scripts/createdb.sh index bfeece3..8f2e230 100755 --- a/scripts/createdb.sh +++ b/scripts/createdb.sh @@ -1,11 +1,5 @@ #!/usr/bin/env bash -# This script performs the mysql_secure_installation -# Creates the birds database -# Creates the detections table -# Creates the birder user and grants them appropriate -# permissions -# If using this script to re-initialize (DROP then CREATE) -# the DB, be sure to run this as root or with sudo +set -x source /etc/birdnet/birdnet.conf sqlite3 /home/pi/BirdNET-Pi/scripts/birds.db << EOF DROP TABLE IF EXISTS detections; diff --git a/scripts/system_controls.php b/scripts/system_controls.php index cff40b3..7e05fcb 100644 --- a/scripts/system_controls.php +++ b/scripts/system_controls.php @@ -14,6 +14,6 @@