This commit is contained in:
2025-05-27 18:06:36 +02:00
parent 0b3bd9108c
commit bf81566b88
6 changed files with 216 additions and 88 deletions

17
load-options.php Normal file
View File

@ -0,0 +1,17 @@
<?php
require_once "common.php";
require_once "load-conf.php";
$options = [];
if (isset($conf["dhcp-optsfile"]) && file_exists($conf["dhcp-optsfile"])) {
foreach(file($conf["dhcp-optsfile"]) as $line) {
if (preg_match(
"/^(?:tag:(?<tag>$namePtn),)?option:(?<option>$namePtn),(?<value>[^#\r\n]*)$commentPtn$/",
$line, $option
)) {
if (!isset($option["tag"])) $option["tag"] = "default";
if (!isset($options[$option["tag"]])) $options[$option["tag"]] = [];
$options[$option["tag"]][$option["option"]] = $option["value"];
}
}
}