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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user