X-Git-Url: http://git.pjr.cc/?p=CBFWR.git;a=blobdiff_plain;f=libcbfwr%2Fconfig.php;h=372bd04d50123d7ff54d2707053e3f91d3c02417;hp=3c7a54fb5a91cd84042b613254ab0123d6ab7058;hb=60673f4f00bab805471fcbb85c8816aebb3a9582;hpb=c184472f1c4206a3bcd76ff8e9d27dc2eb1a4c4c diff --git a/libcbfwr/config.php b/libcbfwr/config.php index 3c7a54f..372bd04 100644 --- a/libcbfwr/config.php +++ b/libcbfwr/config.php @@ -63,6 +63,7 @@ class Config { } fclose($fp); } + if(file_exists("/sys/class/net/$fname/mtu")) $this->config["hardware"]["netdev"][$fname]["mtu"] = file_get_contents("/sys/class/net/$fname/mtu"); if(file_exists("/sys/class/net/$fname/address")) $this->config["hardware"]["netdev"][$fname]["hwaddress"] = file_get_contents("/sys/class/net/$fname/address"); if(file_exists("/sys/class/net/$fname/bonding")) $this->config["hardware"]["netdev"][$fname]["bonding"] = true; if(file_exists("/sys/class/net/$fname/bridge")) $this->config["hardware"]["netdev"][$fname]["bridge"] = true; @@ -86,7 +87,84 @@ class Config { function mergeConfig($configone, $configtwo) { - // yep + // yep this means apply changes in configtwo to configone + $newconf = $configone; + + // this is gunna be tough its gunna be a meet on meet sandwitch + foreach($configtwo as $key => $var) { + if($key != "status") { + error_log("apply change $key"); + foreach($var as $key2=>$var2) { + error_log("which is $key2"); + $splits = explode(" ", $var2); + + // find a description + $description = null; + $hasdescription = false; + for($i=0; $i