wipp
This commit is contained in:
17
load-options.php
Normal file
17
load-options.php
Normal 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"];
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user