adding stop core services button

This commit is contained in:
Patrick McGuire
2021-10-15 15:06:58 -04:00
parent 837ced6fef
commit 3ae95ce587
4 changed files with 24 additions and 0 deletions
+4
View File
@@ -2,6 +2,10 @@
<input type="submit" value="Edit the birdnet.conf file">
</form>
<form action="/scripts/stop_core_services.php" onclick="return confirm('Stop core services?')">
<input type="submit" value="Stop Core BirdNET-Pi Services">
</form>
<form action="/scripts/restart_services.php" onclick="return confirm('Restart ALL services?')">
<input type="submit" value="Restart ALL BirdNET-Pi Services">
</form>
+4
View File
@@ -0,0 +1,4 @@
<?php
shell_exec("/home/pi/BirdNET-Pi/scripts/stop_core_services.sh");
header('Location: http://birdnetpi.local/scripts/index.html?success=true');
?>
+12
View File
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
# Restarts ALL services and removes ALL unprocessed audio
services=(birdnet_recording.service
birdnet_analysis.service
extraction.timer)
for i in "${services[@]}";do
sudo systemctl stop ${i}
done
sudo rm -rf ${RECS_DIR}/$(date +%B-%Y/%d-%A)/*
+4
View File
@@ -0,0 +1,4 @@
<?php
shell_exec("sudo -u pi /home/pi/BirdNET-Pi/scripts/update_birdnet.sh > /tmp/phpupdate.log 2&>1");
header('Location: http://birdnetpi.local/index.html?success=true');
?>