diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index 139e05590..e377dbce4 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -410,5 +410,13 @@ class Application_Model_Preference public static function GetMaxBitrate(){ return Application_Model_Preference::GetValue("max_bitrate"); } + + public static function SetPlanLevel($plan){ + Application_Model_Preference::SetValue("plan_level", $plan); + } + + public static function GetPlanLevel(){ + return Application_Model_Preference::GetValue("plan_level"); + } } diff --git a/utils/airtime-stream b/utils/airtime-system similarity index 97% rename from utils/airtime-stream rename to utils/airtime-system index 6e0f25d25..f6cec9cfe 100755 --- a/utils/airtime-stream +++ b/utils/airtime-system @@ -31,4 +31,4 @@ SCRIPTPATH=`dirname $SCRIPT` invokePwd=$PWD cd $SCRIPTPATH -php -q airtime-stream.php "$@" || exit 1 +php -q airtime-system.php "$@" || exit 1 diff --git a/utils/airtime-stream.php b/utils/airtime-system.php similarity index 78% rename from utils/airtime-stream.php rename to utils/airtime-system.php index 14f839f40..8a31ea4c8 100644 --- a/utils/airtime-stream.php +++ b/utils/airtime-system.php @@ -26,13 +26,15 @@ function printUsage() echo "\n"; echo "airtime-stream\n"; echo "===============\n"; - echo " This program allows you to manage Airtime stream.\n"; + echo " This program allows you to manage Airtime system.\n"; echo "\n"; echo "OPTIONS:\n"; echo " --maxbitrate \n"; echo " Set the max bitrate allowed by Airtime.\n"; echo " --numofstream \n"; echo " Set the number of stream allowed by Airtime.\n"; + echo " --planlevel \n"; + echo " Set the plan type for Airtime system.(trial, regular).\n"; echo "\n"; } @@ -51,6 +53,9 @@ switch ($argv[1]) { case '--numofstream': $action = "numofstream"; break; + case '--planlevel': + $action = "planlevel"; + break; } $optionArg = $argv[2]; @@ -70,6 +75,15 @@ if ($action == "maxbitrate") { Application_Model_Preference::SetMaxBitrate($optionArg); } elseif ($action == "numofstream") { Application_Model_Preference::SetNumOfStreams($optionArg); +} elseif ($action == "planlevel"){ + $plans = array("trial", "regular"); + if(in_array($optionArg, $plans)){ + Application_Model_Preference::SetPlanLevel($optionArg); + echo "Setting the plan level to '$optionArg'.".PHP_EOL; + }else{ + echo "Error: Unknown plan level '$optionArg'.".PHP_EOL; + exit; + } } function GetAirtimeConf()