Updating CADDY_PWD config updating to allow special characters

This commit is contained in:
Jake Herbst
2022-05-15 13:36:00 -04:00
parent 7948328f39
commit 8a6d79b642
+2 -3
View File
@@ -33,12 +33,11 @@ if(isset($_GET['submit'])) {
if(isset($_GET["caddy_pwd"])) {
$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", $contents2);
$contents = 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);
fwrite($fh2, $contents2);
fwrite($fh2, $contents);
exec('sudo /usr/local/bin/update_caddyfile.sh > /dev/null 2>&1 &');
}
}