From 9a9f233c40bf09834402491bf657fffa446eeada Mon Sep 17 00:00:00 2001 From: paulr Date: Wed, 21 Sep 2011 03:59:38 +1000 Subject: [PATCH] more config and web page stuff --- libcbfwr/config.php | 3 ++- libcbfwr/web.php | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletions(-) diff --git a/libcbfwr/config.php b/libcbfwr/config.php index 9ca0ff9..7bffc1d 100644 --- a/libcbfwr/config.php +++ b/libcbfwr/config.php @@ -31,7 +31,7 @@ class Config { $this->config_file = "../var/"; } else { echo "No directory where i can create a config, bailing\n"; - $this->config["status"] = "unconf"; + $this->config["status"] = "nodir"; } } @@ -93,6 +93,7 @@ class Config { } fclose($fp); } + 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; } diff --git a/libcbfwr/web.php b/libcbfwr/web.php index aa039a8..eba5ce0 100644 --- a/libcbfwr/web.php +++ b/libcbfwr/web.php @@ -22,6 +22,14 @@ class CBFWWeb { { $url = "/"; $bodycontent = null; + + $conf = new Config(); + $conf->loadConfig(); + $rconfig = $conf->getConfig(); + + if($rconfig["status"] != "conf") cbfw_startinstaller(); + + if(isset($_REQUEST["q"])) { $url = $_REQUEST["q"]; -- 1.7.0.4