if(!$debug)exec($start_str.' > /dev/null 2>&1 &');// "> /dev/null 2>&1 &" makes sure it is really really run as a background job that does not wait for input
elseexec($start_str.$debug.' 2>&1 &');
for($i=0;$i<5;$i++){
if(is_file("/var/state/camogm.state"))break;
if(file_exists($cmd_pipe))
break;
sleep(1);
}
if($debug){
$fcmd=fopen($cmd_pipe,"w");
fprintf($fcmd,"debuglev=$debuglev");
fclose($fcmd);
}
// set fast recording mode if there is at least one suitable partition or revert to legacy 'mov' mode