fixed rebooting issue -- now deletes truncated audio files
adding new index.html to support php buttons adding restart_services.php as first button
This commit is contained in:
@@ -76,19 +76,23 @@ run_analysis() {
|
|||||||
|
|
||||||
cd ${HOME}/BirdNET-Lite || exit 1
|
cd ${HOME}/BirdNET-Lite || exit 1
|
||||||
for i in "${files[@]}";do
|
for i in "${files[@]}";do
|
||||||
|
|
||||||
[ -z ${RECORDING_LENGTH} ] && RECORDING_LENGTH=12
|
[ -z ${RECORDING_LENGTH} ] && RECORDING_LENGTH=12
|
||||||
[ ${RECORDING_LENGTH} == "60" ] && RECORDING_LENGTH=01:00
|
[ ${RECORDING_LENGTH} == "60" ] && RECORDING_LENGTH=01:00
|
||||||
FILE_LENGTH="$(ffmpeg -i ${1}/${i} 2>&1 | awk -F. '/Duration/ {print $1}' | cut -d':' -f3-4)"
|
FILE_LENGTH="$(ffmpeg -i ${1}/${i} 2>&1 | awk -F. '/Duration/ {print $1}' | cut -d':' -f3-4)"
|
||||||
[ -z $FILE_LENGTH ] && sleep 2 && continue
|
[ -z $FILE_LENGTH ] && sleep 3 && continue
|
||||||
echo "RECORDING_LENGTH set to ${RECORDING_LENGTH}"
|
echo "RECORDING_LENGTH set to ${RECORDING_LENGTH}"
|
||||||
|
a=1
|
||||||
if [ ${RECORDING_LENGTH} == "01:00" ];then
|
if [ ${RECORDING_LENGTH} == "01:00" ];then
|
||||||
until [ "$(ffmpeg -i ${1}/${i} 2>&1 | awk -F. '/Duration/ {print $1}' | cut -d':' -f3-4)" == "${RECORDING_LENGTH}" ];do
|
until [ "$(ffmpeg -i ${1}/${i} 2>&1 | awk -F. '/Duration/ {print $1}' | cut -d':' -f3-4)" == "${RECORDING_LENGTH}" ];do
|
||||||
sleep 1
|
sleep 1
|
||||||
|
[ $a -ge ${RECORDING_LENGTH} ] && sudo rm -f ${1}/${i} && break
|
||||||
|
a=$((a+1))
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
until [ "$(ffmpeg -i ${1}/${i} 2>&1 | awk -F. '/Duration/ {print $1}' | cut -d':' -f3-4)" == "00:${RECORDING_LENGTH}" ];do
|
until [ "$(ffmpeg -i ${1}/${i} 2>&1 | awk -F. '/Duration/ {print $1}' | cut -d':' -f3-4)" == "00:${RECORDING_LENGTH}" ];do
|
||||||
sleep 1
|
sleep 1
|
||||||
|
[ $a -ge ${RECORDING_LENGTH} ] && sudo rm -f ${1}/${i} && break
|
||||||
|
a=$((a+1))
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<form action="/scripts/restart_services.php">
|
||||||
|
<input type="submit" value="Restart BirdNET-system">
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<form action="/scripts/restart_services.php">
|
||||||
|
<input type="submit" value="Restart BirdNET-system">
|
||||||
|
</form>
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
source /etc/birdnet/birdnet.conf
|
source /etc/birdnet/birdnet.conf
|
||||||
|
|
||||||
sudo systemctl stop birdnet_recording.service
|
sudo systemctl stop birdnet_recording.service
|
||||||
rm -rf ${RECS_DIR}/$(date +%B-%Y/%d-%A)/*
|
sudo rm -rf ${RECS_DIR}/$(date +%B-%Y/%d-%A)/*
|
||||||
sudo systemctl start birdnet_recording.service
|
sudo systemctl start birdnet_recording.service
|
||||||
sudo systemctl restart extraction.timer
|
sudo systemctl restart extraction.timer
|
||||||
sudo systemctl restart birdnet_analysis.service
|
sudo systemctl restart birdnet_analysis.service
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<?php
|
||||||
|
shell_exec("/home/pi/BirdNET-Lite/scripts/restart_birdnet.sh");
|
||||||
|
header('Location: http://birdnetsystem.local/scripts/index.html?success=true');
|
||||||
|
?>
|
||||||
Reference in New Issue
Block a user