fixing clear_all_data errors

This commit is contained in:
mcguirepr89
2022-03-08 11:37:10 -05:00
parent cb8515d82c
commit 834ea5e49a
3 changed files with 5 additions and 11 deletions
+3 -3
View File
@@ -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
+1 -7
View File
@@ -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;
+1 -1
View File
@@ -14,6 +14,6 @@
<button type="submit" name="submit" value="sudo shutdown now" onclick="return confirm('Are you sure you want to shutdown?')">Shutdown</button>
</form>
<form action="" method="POST">
<button type="submit" name="submit" value="clear_all_data.sh" onclick="return confirm('Clear ALL Data? This cannot be undone.')">Clear ALL data</button>
<button type="submit" name="submit" value="sudo -upi clear_all_data.sh" onclick="return confirm('Clear ALL Data? This cannot be undone.')">Clear ALL data</button>
</form>
</div>