logger - ensure params are escaped

This commit is contained in:
ljm42
2024-02-01 15:49:17 -07:00
parent b8844dcedb
commit 305e4648aa
12 changed files with 52 additions and 45 deletions
+4 -1
View File
@@ -12,6 +12,9 @@
*/
?>
<?
$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp');
require_once "$docroot/webGui/include/Wrappers.php";
$set = $ifname = $argv[1];
$run = $set != 'none';
$ini = parse_ini_file('/var/local/emhttp/network.ini',true); ksort($ini,SORT_NATURAL);
@@ -25,7 +28,7 @@ function update_wireguard($ifname) {
$vtun = basename($wg,'.conf');
// interface has changed?
if (exec("grep -Pom1 ' dev $nic ' $wg")=='') {
exec("logger -t netconfig -- \"updated wireguard $vtun configuration\"");
my_logger('netconfig', "updated wireguard $vtun configuration");
exec("sed -ri 's/ dev (br0|bond0|eth0) / dev $nic /' $wg");
}
// restart active wireguard tunnels