X-Git-Url: http://git.pjr.cc/?p=CBFWR.git;a=blobdiff_plain;f=bin%2Fcbfwrd.php;h=4a9f5a513b628cab87297234b3342a869e9b5bfa;hp=b5a91b3604ab39adc5b6190878d0b8b46a8676f1;hb=60673f4f00bab805471fcbb85c8816aebb3a9582;hpb=a52a53bbe7ad884562d7fb39c87442a38e331dd2 diff --git a/bin/cbfwrd.php b/bin/cbfwrd.php index b5a91b3..4a9f5a5 100644 --- a/bin/cbfwrd.php +++ b/bin/cbfwrd.php @@ -1,9 +1,9 @@ findHardware(); + $conf = $config->getConfig(); + $comms->putConfig($conf, 1); + exit(0); + } +} // now we got into daemon modes $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; + $msg = $comms->waitForMessage(); - $comms->putConfig($config->getConfig()); + //echo "Got message: $msg\n"; + if($msg == "quit") $cont = false; + else cbfwd_commandProcessor($msg); +} + + +function cbfwd_commandProcessor($command) +{ + global $config; + $cmds = explode(" ", $command); + $comms = new Comms; - $cont = false; + $comms->lockConfigs(); + switch($cmds[0]) { + case "applyclientconfig": + break; + + } + $comms->unlockConfigs(); } ?> \ No newline at end of file