Merge branch 'mcguirepr89:main' into main
This commit is contained in:
@@ -66,13 +66,14 @@ if(isset($_GET['submit'])) {
|
|||||||
if(isset($_GET["rtsp_stream"])) {
|
if(isset($_GET["rtsp_stream"])) {
|
||||||
$rtsp_stream = str_replace("\r\n", ",", $_GET["rtsp_stream"]);
|
$rtsp_stream = str_replace("\r\n", ",", $_GET["rtsp_stream"]);
|
||||||
if(strcmp($rtsp_stream,$config['RTSP_STREAM']) !== 0) {
|
if(strcmp($rtsp_stream,$config['RTSP_STREAM']) !== 0) {
|
||||||
$contents = preg_replace("/RTSP_STREAM=.*/", "RTSP_STREAM=$rtsp_stream", $contents);
|
$contents = preg_replace("/RTSP_STREAM=.*/", "RTSP_STREAM=\"$rtsp_stream\"", $contents);
|
||||||
$contents2 = preg_replace("/RTSP_STREAM=.*/", "RTSP_STREAM=$rtsp_stream", $contents2);
|
$contents2 = preg_replace("/RTSP_STREAM=.*/", "RTSP_STREAM=\"$rtsp_stream\"", $contents2);
|
||||||
$fh = fopen('/etc/birdnet/birdnet.conf', "w");
|
$fh = fopen('/etc/birdnet/birdnet.conf', "w");
|
||||||
$fh2 = fopen("./scripts/thisrun.txt", "w");
|
$fh2 = fopen("./scripts/thisrun.txt", "w");
|
||||||
fwrite($fh, $contents);
|
fwrite($fh, $contents);
|
||||||
fwrite($fh2, $contents2);
|
fwrite($fh2, $contents2);
|
||||||
exec('sudo systemctl restart birdnet_recording.service');
|
exec('sudo systemctl restart birdnet_recording.service');
|
||||||
|
exec('sudo systemctl restart livestream.service');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -100,7 +100,13 @@ run_analysis() {
|
|||||||
echo "${1}/${i}" > $HOME/BirdNET-Pi/analyzing_now.txt
|
echo "${1}/${i}" > $HOME/BirdNET-Pi/analyzing_now.txt
|
||||||
[ -z ${RECORDING_LENGTH} ] && RECORDING_LENGTH=15
|
[ -z ${RECORDING_LENGTH} ] && RECORDING_LENGTH=15
|
||||||
echo "RECORDING_LENGTH set to ${RECORDING_LENGTH}"
|
echo "RECORDING_LENGTH set to ${RECORDING_LENGTH}"
|
||||||
|
itr=0
|
||||||
until [ -z "$(lsof -t ${1}/${i})" ];do
|
until [ -z "$(lsof -t ${1}/${i})" ];do
|
||||||
|
itr=$((itr+1))
|
||||||
|
if [ $itr -eq $(($RECORDING_LENGTH * 3)) ]; then
|
||||||
|
echo "Maximum number of attempts exceeded. Exiting & restarting service."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ if [ "${used//%}" -ge 95 ]; then
|
|||||||
fi
|
fi
|
||||||
((iter++))
|
((iter++))
|
||||||
done
|
done
|
||||||
|
find ~/BirdSongs/ -type d -empty -mtime +90 -delete
|
||||||
find ${EXTRACTED}/By_Date/ -empty -type d -delete;;
|
find ${EXTRACTED}/By_Date/ -empty -type d -delete;;
|
||||||
|
|
||||||
#rm -drfv "$(find ${EXTRACTED}/By_Date/* -maxdepth 1 -type d -prune \
|
#rm -drfv "$(find ${EXTRACTED}/By_Date/* -maxdepth 1 -type d -prune \
|
||||||
|
|||||||
@@ -157,7 +157,12 @@ CREATE INDEX IF NOT EXISTS "detections_Com_Name" ON "detections" ("Com_Name");
|
|||||||
CREATE INDEX IF NOT EXISTS "detections_Date_Time" ON "detections" ("Date" DESC, "Time" DESC);
|
CREATE INDEX IF NOT EXISTS "detections_Date_Time" ON "detections" ("Date" DESC, "Time" DESC);
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
$HOME/BirdNET-Pi/birdnet/bin/pip3 install apprise==1.2.1
|
$HOME/BirdNET-Pi/birdnet/bin/pip3 install apprise==1.2.1 >/dev/null
|
||||||
|
|
||||||
|
if ! grep -q 'RuntimeMaxSec=' "$HOME/BirdNET-Pi/templates/birdnet_analysis.service"&>/dev/null; then
|
||||||
|
sudo -E sed -i '/\[Service\]/a RuntimeMaxSec=3600' "$HOME/BirdNET-Pi/templates/birdnet_analysis.service"
|
||||||
|
sudo systemctl daemon-reload && restart_services.sh
|
||||||
|
fi
|
||||||
|
|
||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload
|
||||||
restart_services.sh
|
restart_services.sh
|
||||||
|
|||||||
Reference in New Issue
Block a user