X-Git-Url: http://git.pjr.cc/?p=CBFWR.git;a=blobdiff_plain;f=bin%2Fcbfwrd.php;h=7271d4aec7acf7e344ea84316d369f6f79eb00d7;hp=b5a91b3604ab39adc5b6190878d0b8b46a8676f1;hb=4b79d489f91d4bca8b1451daa3415b73545b08c2;hpb=a52a53bbe7ad884562d7fb39c87442a38e331dd2 diff --git a/bin/cbfwrd.php b/bin/cbfwrd.php index b5a91b3..7271d4a 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,24 @@ $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) +{ + $cmds = explode(" ", $command); + + switch($cmds[0]) { + case "...": + break; + } } ?> \ No newline at end of file