X-Git-Url: http://git.pjr.cc/?p=CBFWR.git;a=blobdiff_plain;f=bin%2Fcbfwrd.php;h=4a9f5a513b628cab87297234b3342a869e9b5bfa;hp=7271d4aec7acf7e344ea84316d369f6f79eb00d7;hb=60673f4f00bab805471fcbb85c8816aebb3a9582;hpb=4b79d489f91d4bca8b1451daa3415b73545b08c2 diff --git a/bin/cbfwrd.php b/bin/cbfwrd.php index 7271d4a..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); } } @@ -35,13 +38,21 @@ $cont = true; // setup our sem/shm stuff -// this stuff needs to go in comms +// do the initial stuff +$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) { - $comms = new Comms; - - $config->loadConfig(); - $comms->putConfig($config->getConfig()); - $msg = $comms->waitForMessage(); //echo "Got message: $msg\n"; @@ -52,11 +63,16 @@ while($cont) { function cbfwd_commandProcessor($command) { + global $config; $cmds = explode(" ", $command); + $comms = new Comms; + $comms->lockConfigs(); switch($cmds[0]) { - case "...": + case "applyclientconfig": break; + } + $comms->unlockConfigs(); } ?> \ No newline at end of file