X-Git-Url: http://git.pjr.cc/?p=CBFWR.git;a=blobdiff_plain;f=bin%2Fcbfwrd.php;h=d2a0e833e8ac671f106ebf74ccb24c801dfa19a1;hp=b5a91b3604ab39adc5b6190878d0b8b46a8676f1;hb=6bbd32f7123ad8e964156bbb42909e47eeeef0c1;hpb=a52a53bbe7ad884562d7fb39c87442a38e331dd2 diff --git a/bin/cbfwrd.php b/bin/cbfwrd.php index b5a91b3..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,8 +39,19 @@ $cont = true; while($cont) { $comms = new Comms; + $config->loadConfig(); $comms->putConfig($config->getConfig()); - $cont = false; + $msg = $comms->waitForMessage(); + + //echo "Got message: $msg\n"; + if($msg == "quit") $cont = false; + else cbfwd_commandProcessor($msg); +} + + +function cbfwd_commandProcessor($command) +{ + } ?> \ No newline at end of file