\n"; echo " Set the max bitrate allowed by Airtime.\n"; echo " --numofstream \n"; echo " Set the number of stream allowed by Airtime.\n"; echo "\n"; } if (count($argv) != 3) { printUsage(); exit; } $action = null; switch ($argv[1]) { case '--maxbitrate': $action = "maxbitrate"; break; case '--numofstream': $action = "numofstream"; break; } $optionArg = $argv[2]; if (is_null($action)) { printUsage(); exit; } PEAR::setErrorHandling(PEAR_ERROR_RETURN); $CC_DBC = DB::connect($CC_CONFIG['dsn'], TRUE); if (PEAR::isError($CC_DBC)) { die($CC_DBC->getMessage()); } $CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC); if ($action == "maxbitrate") { Application_Model_Preference::SetMaxBitrate($optionArg); } elseif ($action == "numofstream") { Application_Model_Preference::SetNumOfStreams($optionArg); } function GetAirtimeConf() { $ini = parse_ini_file("/etc/airtime/airtime.conf", true); if ($ini === false){ echo "Error reading /etc/airtime/airtime.conf.".PHP_EOL; exit; } return $ini; }