CC-2756: airtime-system remove
This commit is contained in:
parent
c6557e1280
commit
a636257516
2 changed files with 0 additions and 133 deletions
|
@ -1,34 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
#-------------------------------------------------------------------------------
|
|
||||||
# Copyright (c) 2010 Sourcefabric O.P.S.
|
|
||||||
#
|
|
||||||
# This file is part of the Airtime project.
|
|
||||||
# http://airtime.sourcefabric.org/
|
|
||||||
#
|
|
||||||
# Airtime is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2 of the License, or
|
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
|
||||||
# Airtime is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with Airtime; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
#
|
|
||||||
#-------------------------------------------------------------------------------
|
|
||||||
#-------------------------------------------------------------------------------
|
|
||||||
# This script sets stream setting(max bitrate and number of streams in Airtime.
|
|
||||||
#
|
|
||||||
# Absolute path to this script
|
|
||||||
SCRIPT=`readlink -f $0`
|
|
||||||
# Absolute directory this script is in
|
|
||||||
SCRIPTPATH=`dirname $SCRIPT`
|
|
||||||
|
|
||||||
invokePwd=$PWD
|
|
||||||
cd $SCRIPTPATH
|
|
||||||
|
|
||||||
php -q airtime-system.php "$@" || exit 1
|
|
|
@ -1,99 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
$airtimeIni = GetAirtimeConf();
|
|
||||||
$airtime_base_dir = $airtimeIni['general']['airtime_dir'];
|
|
||||||
|
|
||||||
set_include_path("$airtime_base_dir/application/models" . PATH_SEPARATOR . get_include_path());
|
|
||||||
require_once("$airtime_base_dir/library/propel/runtime/lib/Propel.php");
|
|
||||||
Propel::init("$airtime_base_dir/application/configs/airtime-conf.php");
|
|
||||||
|
|
||||||
require_once("$airtime_base_dir/application/configs/conf.php");
|
|
||||||
require_once("$airtime_base_dir/application/models/Preference.php");
|
|
||||||
require_once('DB.php');
|
|
||||||
require_once('Console/Getopt.php');
|
|
||||||
|
|
||||||
// Do not allow remote execution
|
|
||||||
$arr = array_diff_assoc($_SERVER, $_ENV);
|
|
||||||
if (isset($arr["DOCUMENT_ROOT"]) && ($arr["DOCUMENT_ROOT"] != "") ) {
|
|
||||||
header("HTTP/1.1 400");
|
|
||||||
header("Content-type: text/plain; charset=UTF-8");
|
|
||||||
echo "400 Not executable\r\n";
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
function printUsage()
|
|
||||||
{
|
|
||||||
echo "\n";
|
|
||||||
echo "airtime-stream\n";
|
|
||||||
echo "===============\n";
|
|
||||||
echo " This program allows you to manage Airtime system.\n";
|
|
||||||
echo "\n";
|
|
||||||
echo "OPTIONS:\n";
|
|
||||||
echo " --maxbitrate <bitrate>\n";
|
|
||||||
echo " Set the max bitrate allowed by Airtime.\n";
|
|
||||||
echo " --numofstream <numofstream>\n";
|
|
||||||
echo " Set the number of stream allowed by Airtime.\n";
|
|
||||||
echo " --planlevel <planname>\n";
|
|
||||||
echo " Set the plan type for Airtime system.(trial, regular).\n";
|
|
||||||
echo "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (count($argv) != 3) {
|
|
||||||
printUsage();
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$action = null;
|
|
||||||
switch ($argv[1]) {
|
|
||||||
case '--maxbitrate':
|
|
||||||
$action = "maxbitrate";
|
|
||||||
break;
|
|
||||||
case '--numofstream':
|
|
||||||
$action = "numofstream";
|
|
||||||
break;
|
|
||||||
case '--planlevel':
|
|
||||||
$action = "planlevel";
|
|
||||||
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);
|
|
||||||
} 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()
|
|
||||||
{
|
|
||||||
$ini = parse_ini_file("/etc/airtime/airtime.conf", true);
|
|
||||||
|
|
||||||
if ($ini === false){
|
|
||||||
echo "Error reading /etc/airtime/airtime.conf.".PHP_EOL;
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $ini;
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue