X-Git-Url: http://git.pjr.cc/?p=CBFWR.git;a=blobdiff_plain;f=bin%2Fcbfwrd.php;h=d2a0e833e8ac671f106ebf74ccb24c801dfa19a1;hp=3b2987015833f4447399c32120aee6037ad63c6c;hb=6bbd32f7123ad8e964156bbb42909e47eeeef0c1;hpb=90e37664d8296ebb5f3aae443b44b09f95826e90 diff --git a/bin/cbfwrd.php b/bin/cbfwrd.php index 3b29870..d2a0e83 100644 --- a/bin/cbfwrd.php +++ b/bin/cbfwrd.php @@ -19,8 +19,17 @@ glcas_pluginLoader(); error_log("CBFWRD starting"); + $config = new Config(); +if(isset($argv[1])) { + if($argv[1] == "boot") { + // we get called here on boot. + $config->bootHardware(); + exit(0); + } +} + // now we got into daemon modes $cont = true; @@ -30,12 +39,19 @@ $cont = true; while($cont) { $comms = new Comms; + $config->loadConfig(); $comms->putConfig($config->getConfig()); $msg = $comms->waitForMessage(); //echo "Got message: $msg\n"; + if($msg == "quit") $cont = false; + else cbfwd_commandProcessor($msg); +} + + +function cbfwd_commandProcessor($command) +{ - $cont = false; } ?> \ No newline at end of file