X-Git-Url: http://git.pjr.cc/?p=CBFWR.git;a=blobdiff_plain;f=bin%2Fcbfwrd.php;h=4a9f5a513b628cab87297234b3342a869e9b5bfa;hp=23897e17b0aae279a117757040a91a3fa46eaa2b;hb=60673f4f00bab805471fcbb85c8816aebb3a9582;hpb=22c669bff35547784d89c2c5c87e4311be63500b diff --git a/bin/cbfwrd.php b/bin/cbfwrd.php index 23897e1..4a9f5a5 100644 --- a/bin/cbfwrd.php +++ b/bin/cbfwrd.php @@ -1,7 +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 + +// 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) { + $msg = $comms->waitForMessage(); + + //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; + + $comms->lockConfigs(); + switch($cmds[0]) { + case "applyclientconfig": + break; + + } + $comms->unlockConfigs(); +} ?> \ No newline at end of file