From 697f19484e8d9ad364117a4890447535629b1e24 Mon Sep 17 00:00:00 2001 From: Patrick McGuire <60325264+mcguirepr89@users.noreply.github.com> Date: Sun, 15 May 2022 14:29:04 -0400 Subject: [PATCH] Re-adding contents2 for `thisrun.txt` use This is still needed for a silly reason which is that BirdNET-Pi does not have a good common configuration file that bash, PHP, and Python share -- instead, PHP and Python read from `thisrun.txt` which is pretty much .ini formatted, while bash uses `birdnet.conf`. Things that update one typically update the other in tandem. It's not best practice by any means. (Nor is storing the Caddy password in plaintext in a configuration file, so that sucks, too . . .) --- scripts/advanced.php | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/advanced.php b/scripts/advanced.php index 31d90fa..a4c1508 100644 --- a/scripts/advanced.php +++ b/scripts/advanced.php @@ -34,6 +34,7 @@ if(isset($_GET['submit'])) { $caddy_pwd = $_GET["caddy_pwd"]; if(strcmp($caddy_pwd,$config['CADDY_PWD']) !== 0) { $contents = preg_replace("/CADDY_PWD=.*/", "CADDY_PWD=\"$caddy_pwd\"", $contents); + $contents2 = preg_replace("/CADDY_PWD=.*/", "CADDY_PWD=\"$caddy_pwd\"", $contents); $fh = fopen('/etc/birdnet/birdnet.conf', "w"); $fh2 = fopen("./scripts/thisrun.txt", "w"); fwrite($fh, $contents);