CC-2514: new airtime-import
-airtime-import for install and upgrade scripts
This commit is contained in:
parent
063afda7ff
commit
ed8d247b17
|
@ -309,7 +309,7 @@ class AirtimeInstall
|
||||||
AirtimeInstall::RemoveSymlinks();
|
AirtimeInstall::RemoveSymlinks();
|
||||||
|
|
||||||
echo "* Installing airtime-import".PHP_EOL;
|
echo "* Installing airtime-import".PHP_EOL;
|
||||||
$dir = AirtimeInstall::CONF_DIR_BINARIES."/utils/airtime-import";
|
$dir = AirtimeInstall::CONF_DIR_BINARIES."/utils/airtime-import/airtime-import";
|
||||||
exec("ln -s $dir /usr/bin/airtime-import");
|
exec("ln -s $dir /usr/bin/airtime-import");
|
||||||
|
|
||||||
echo "* Installing airtime-update-db-settings".PHP_EOL;
|
echo "* Installing airtime-update-db-settings".PHP_EOL;
|
||||||
|
|
|
@ -38,7 +38,7 @@ function MigrateTablesToVersion($version)
|
||||||
system($command);
|
system($command);
|
||||||
}
|
}
|
||||||
|
|
||||||
function InstallPhpCode($phpDir)
|
function InstallAirtimePhpServerCode($phpDir)
|
||||||
{
|
{
|
||||||
global $CC_CONFIG;
|
global $CC_CONFIG;
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ function InstallPhpCode($phpDir)
|
||||||
exec("cp -R ".$AIRTIME_SRC."/* ".$phpDir);
|
exec("cp -R ".$AIRTIME_SRC."/* ".$phpDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
function InstallBinaries()
|
function CopyUtils()
|
||||||
{
|
{
|
||||||
$utilsSrc = __DIR__."/../../../utils";
|
$utilsSrc = __DIR__."/../../../utils";
|
||||||
|
|
||||||
|
@ -58,6 +58,8 @@ function InstallBinaries()
|
||||||
exec("cp -R ".$utilsSrc." ".CONF_DIR_BINARIES);
|
exec("cp -R ".$utilsSrc." ".CONF_DIR_BINARIES);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Removes pypo, media-monitor, show-recorder and utils from system. These will
|
||||||
|
be reinstalled by the main airtime-upgrade script. */
|
||||||
function UninstallBinaries()
|
function UninstallBinaries()
|
||||||
{
|
{
|
||||||
echo "* Removing Airtime binaries from ".CONF_DIR_BINARIES.PHP_EOL;
|
echo "* Removing Airtime binaries from ".CONF_DIR_BINARIES.PHP_EOL;
|
||||||
|
@ -65,6 +67,16 @@ function UninstallBinaries()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function removeOldAirtimeImport(){
|
||||||
|
exec('rm -f "/usr/lib/airtime/utils/airtime-import"');
|
||||||
|
exec('rm -f "/usr/lib/airtime/utils/airtime-import.php"');
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateAirtimeImportSymLink(){
|
||||||
|
$dir = "/usr/lib/airtime/utils/airtime-import/airtime-import";
|
||||||
|
exec("ln -s $dir /usr/bin/airtime-import");
|
||||||
|
}
|
||||||
|
|
||||||
/* In version 1.9.0 we have have switched from daemontools to more traditional
|
/* 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
|
* init.d daemon system. Let's remove all the daemontools files
|
||||||
*/
|
*/
|
||||||
|
@ -103,8 +115,15 @@ foreach ($pathnames as $pn){
|
||||||
$values = parse_ini_file(CONF_FILE_AIRTIME, true);
|
$values = parse_ini_file(CONF_FILE_AIRTIME, true);
|
||||||
$phpDir = $values['general']['airtime_dir'];
|
$phpDir = $values['general']['airtime_dir'];
|
||||||
|
|
||||||
InstallPhpCode($phpDir);
|
InstallAirtimePhpServerCode($phpDir);
|
||||||
|
|
||||||
//update utils (/usr/lib/airtime) folder
|
//update utils (/usr/lib/airtime) folder
|
||||||
UninstallBinaries();
|
UninstallBinaries();
|
||||||
InstallBinaries();
|
CopyUtils();
|
||||||
|
|
||||||
|
removeOldAirtimeImport();
|
||||||
|
updateAirtimeImportSymLink();
|
||||||
|
|
||||||
|
|
||||||
|
//need to change database because old format had full path while new database has partial paths
|
||||||
|
//also need to add new column
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Location of pypo_cli.py Python script
|
||||||
|
airtime_import_path="/usr/lib/airtime/utils/airtime-import/"
|
||||||
|
airtime_import_script="airtime-import.py"
|
||||||
|
|
||||||
|
api_client_path="/usr/lib/airtime/pypo/"
|
||||||
|
cd ${airtime_import_path}
|
||||||
|
|
||||||
|
exec 2>&1
|
||||||
|
|
||||||
|
export PYTHONPATH=${api_client_path}
|
||||||
|
|
||||||
|
# Note the -u when calling python! we need it to get unbuffered binary stdout and stderr
|
||||||
|
exec python -u ${airtime_import_path}${airtime_import_script} $@
|
||||||
|
|
||||||
|
# EOF
|
|
@ -166,7 +166,6 @@ if ("-c" in sys.argv or "-copy" in sys.argv or "-l" in sys.argv or "-link" in sy
|
||||||
args = parser.parse_args(['-h'])
|
args = parser.parse_args(['-h'])
|
||||||
else:
|
else:
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
print args
|
|
||||||
#format args.path
|
#format args.path
|
||||||
if(hasattr(args,'path')):
|
if(hasattr(args,'path')):
|
||||||
if(args.path[-1] != '/'):
|
if(args.path[-1] != '/'):
|
Loading…
Reference in New Issue