This commit is contained in:
ehpersonal38
2023-02-17 20:06:56 -05:00
parent 6c0fd42525
commit 75bc9918ef
+3 -2
View File
@@ -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');
} }
} }