adding new php scripts

This commit is contained in:
Patrick McGuire
2021-10-03 17:43:43 -04:00
parent 6faa1db7bd
commit fe6561374c
13 changed files with 76 additions and 13 deletions
+5 -7
View File
@@ -128,16 +128,14 @@ for h in "${SCAN_DIRS[@]}";do
# directory.
### TESTING longer extraction context
set -x
[ -z ${EXTRACTION_LENGTH} ] && EXTRACTION_LENGTH=6
SPACER=$(echo "(${EXTRACTION_LENGTH} - 3 )/2" |bc -l)
START=$(echo "${START} - ${SPACER}"|bc -l)
END=$(echo "${END} + ${SPACER}"|bc -l)
SPACER=$(echo "scale=1;(${EXTRACTION_LENGTH} - 3 )/2" |bc -l)
START=$(echo "scale=1;${START} - ${SPACER}"|bc -l)
END=$(echo "scale=1;${END} + ${SPACER}"|bc -l)
if (( $(echo "${START} < 0" | bc -l) ));then START=0;fi
if (( $(echo "${END} > ${RECORDING_LENGTH}" | bc -l) ));then END=${RECORDING_LENGTH};fi
if (( $(echo "scale=1;${START} < 1" | bc -l) ));then START=0;fi
if (( $(echo "scale=1;${END} > ${RECORDING_LENGTH}" | bc -l) ));then END=${RECORDING_LENGTH};fi
set +x
ffmpeg -hide_banner -loglevel error -nostdin -i "${h}/${OLDFILE}" \
-acodec copy -ss "${START}" -to "${END}"\
"${NEWSPECIES_BYDATE}/${a}-${NEWFILE}"
+20 -3
View File
@@ -1,7 +1,24 @@
<form action="/scripts/restart_services.php">
<input type="submit" value="Restart BirdNET-system">
<input type="submit" value="Restart ALL BirdNET-system Services">
</form>
<form action="/scripts/restart_services.php">
<input type="submit" value="Restart BirdNET-system">
<form action="/scripts/restart_birdnet_analysis.php">
<input type="submit" value="Restart BirdNET Analysis Service">
</form>
<form action="/scripts/restart_birdnet_recording.php">
<input type="submit" value="Restart Recording Service">
</form>
<form action="/scripts/restart_extraction.php">
<input type="submit" value="Restart Extraction Service">
</form>
<form action="/scripts/restart_caddy.php">
<input type="submit" value="Restart Caddy">
</form>
<form action="/scripts/reboot_system.php">
<input type="submit" value="Reboot BirdNET-system">
</form>
+4
View File
@@ -0,0 +1,4 @@
<?php
shell_exec("/home/pi/BirdNET-Lite/scripts/reboot_system.sh");
header('Location: http://birdnetsystem.local/scripts/index.html?success=true');
?>
+2
View File
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
sudo reboot
+17 -3
View File
@@ -1,9 +1,23 @@
#!/usr/bin/env bash
# Restart services
# Restarts ALL services and removes ALL unprocessed audio
source /etc/birdnet/birdnet.conf
sudo systemctl stop birdnet_recording.service
sudo rm -rf ${RECS_DIR}/$(date +%B-%Y/%d-%A)/*
sudo systemctl start birdnet_recording.service
sudo systemctl restart extraction.timer
sudo systemctl restart birdnet_analysis.service
SERVICES=(avahi-alias@birdlog.local.service
avahi-alias@birdnetsystem.local.service
avahi-alias@birdstats.local.service
avahi-alias@extractionlog.local.service
birdnet_analysis.service
birdnet_log.service
birdstats.service
extraction.timer
extractionlog.service
livestream.service)
for i in "${SERVICES[@]}";do
sudo systemctl restart ${i}
done
+4
View File
@@ -0,0 +1,4 @@
<?php
shell_exec("/home/pi/BirdNET-Lite/scripts/restart_birdnet_analysis.sh");
header('Location: http://birdnetsystem.local/scripts/index.html?success=true');
?>
+3
View File
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
# Restars the main BirdNET analysis service
sudo systemctl restart birdnet_analysis.service
+4
View File
@@ -0,0 +1,4 @@
<?php
shell_exec("/home/pi/BirdNET-Lite/scripts/restart_birdnet_recording.sh");
header('Location: http://birdnetsystem.local/scripts/index.html?success=true');
?>
+3
View File
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
# Restars the BirdNET Recording service
sudo systemctl restart birdnet_recording.service
+4
View File
@@ -0,0 +1,4 @@
<?php
shell_exec("/home/pi/BirdNET-Lite/scripts/restart_caddy.sh");
header('Location: http://birdnetsystem.local/scripts/index.html?success=true');
?>
+3
View File
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
# Restars the caddy webserver
sudo systemctl restart caddy
+4
View File
@@ -0,0 +1,4 @@
<?php
shell_exec("/home/pi/BirdNET-Lite/scripts/restart_extraction.sh");
header('Location: http://birdnetsystem.local/scripts/index.html?success=true');
?>
+3
View File
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
# Restars the BirdNET Extraction service
sudo systemctl restart extraction.service