cc-2055: switch to init.d

-enable upgrade script
This commit is contained in:
martin 2011-06-01 17:19:28 -04:00
parent 49589c284d
commit e64c8da414
3 changed files with 40 additions and 10 deletions

View File

@ -75,9 +75,9 @@ if(strcmp($version, "1.8.1") < 0) {
if(strcmp($version, "1.8.2") < 0) {
system("php ".__DIR__."/upgrades/airtime-1.8.2/airtime-upgrade.php");
}
//if (strcmp($version, "1.9.0") < 0){
//system("php ".__DIR__."/upgrades/airtime-1.9/airtime-upgrade.php");
//}
if (strcmp($version, "1.9.0") < 0){
system("php ".__DIR__."/upgrades/airtime-1.9/airtime-upgrade.php");
}
//set the new version in the database.

View File

@ -225,7 +225,6 @@ function InstallPhpCode()
echo "* Installing PHP code to ".$CC_CONFIG['phpDir'].PHP_EOL;
exec("mkdir -p ".$CC_CONFIG['phpDir']);
exec("cp -R ".$AIRTIME_SRC."/* ".$CC_CONFIG['phpDir']);
}
function InstallBinaries()

View File

@ -13,6 +13,34 @@ require_once(dirname(__FILE__).'/../../include/AirtimeIni.php');
AirtimeInstall::CreateZendPhpLogFile();
const CONF_DIR_BINARIES = "/usr/lib/airtime";
function InstallPhpCode($phpDir)
{
global $CC_CONFIG;
$AIRTIME_SRC = realpath(__DIR__.'/../../../airtime_mvc');
echo "* Installing PHP code to ".$phpDir.PHP_EOL;
exec("mkdir -p ".$phpDir);
exec("cp -R ".$AIRTIME_SRC."/* ".$phpDir);
}
public static function InstallBinaries()
{
$utilsSrc = __DIR__."/../../../utils";
echo "* Installing binaries to ".CONF_DIR_BINARIES.PHP_EOL;
exec("mkdir -p ".CONF_DIR_BINARIES);
exec("cp -R ".$utilsSrc." ".CONF_DIR_BINARIES);
}
public static function UninstallBinaries()
{
echo "* Removing Airtime binaries from ".CONF_DIR_BINARIES.PHP_EOL;
exec("rm -rf ".CONF_DIR_BINARIES);
}
/* In version 1.9.0 we have have switched from daemontools to more traditional
* init.d daemon system. Let's remove all the daemontools files
@ -44,13 +72,16 @@ $pathnames = array("/usr/bin/airtime-pypo-start",
);
foreach ($pathnames as $pn){
echo "Removing $pn";
echo "Removing $pn\n";
exec("rm -rf ".$pn);
}
/* Run install scripts for pypo, show-recorder and media-monitor.
* This is to install the init.d scripts. */
exec("python ".__DIR__."/../../../python_apps/pypo/install/pypo-install.py");
exec("python ".__DIR__."/../../../python_apps/show-recorder/install/recorder-install.py");
exec("python ".__DIR__."/../../../python_apps/media-monitor/install/media-monitor-install.py");
$values = parse_ini_file(CONF_FILE_AIRTIME, true);
$phpDir = $values['general']['airtime_dir'];
InstallPhpCode($phpDir);
//update utils (/usr/lib/airtime) folder
UninstallBinaries();
InstallBinaries();