X-Git-Url: http://git.pjr.cc/?p=CBFWR.git;a=blobdiff_plain;f=bin%2Fcbfwrd.php;h=4a9f5a513b628cab87297234b3342a869e9b5bfa;hp=b8360e59edff9d8079bc2bf1f1d2981ae09f24ca;hb=60673f4f00bab805471fcbb85c8816aebb3a9582;hpb=0f5458e4a9c18595f7d9501880011369e4e65942 diff --git a/bin/cbfwrd.php b/bin/cbfwrd.php index b8360e5..4a9f5a5 100644 --- a/bin/cbfwrd.php +++ b/bin/cbfwrd.php @@ -1,9 +1,9 @@ bootHardware(); + $config = new Config(false); + $config->findHardware(); + $conf = $config->getConfig(); + $comms->putConfig($conf, 1); exit(0); } } @@ -37,10 +39,18 @@ $cont = true; // setup our sem/shm stuff // do the initial stuff -$comms = new Comms; -$config->loadConfig(); +$config = new Config(true); +$config->loadConfigFile(); $rawconf = $config->getConfig(); $comms->putConfig($rawconf); +$config->applyConfig(); +$runconf["status"] = "nochange"; +$comms->putConfig($runconf, 2); +$res = $comms->getConfig(3); +if($res === false) { + $comms->putConfig($runconf, 3); +} + while($cont) { $msg = $comms->waitForMessage(); @@ -59,30 +69,9 @@ function cbfwd_commandProcessor($command) $comms->lockConfigs(); switch($cmds[0]) { - case "goodone": - break; - - // interface change requests - case "interface": - $int = $cmds[1]; - if($cmds[2] == "changename") { - $rawconf = $comms->getConfig(); - if(isset($rawconf["interface"]["$int"]["name"])) $rawconf["interface"]["$int"]["name"] = $cmds[3]; - $comms->putConfig($rawconf); - } + case "applyclientconfig": break; - case "zone": - $cmd = $cmds[1]; - switch($cmd) { - case "add": - $zonename = $cmds[2]; - $rawconf = $comms->getConfig(); - $rawconf["zone"][$zonename]["name"] = 1; - $comms->putConfig($rawconf); - break; - - } } $comms->unlockConfigs(); }