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 . . .)
This commit is contained in:
Patrick McGuire
2022-05-15 14:29:04 -04:00
committed by GitHub
parent 8a6d79b642
commit 697f19484e
+1
View File
@@ -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);