CC-2567: Install api_client separately from pypo
This commit is contained in:
parent
28b71c61d6
commit
ff2fcde7c0
|
@ -16,6 +16,9 @@ python ${SCRIPTPATH}/../python_apps/create-pypo-user.py
|
|||
|
||||
php ${SCRIPTPATH}/include/airtime-install.php $@
|
||||
|
||||
echo -e "\n*** API Client Installation ***"
|
||||
python ${SCRIPTPATH}/../python_apps/api_clients/install/api_client_install.py
|
||||
|
||||
echo -e "\n*** Pypo Installation ***"
|
||||
python ${SCRIPTPATH}/../python_apps/pypo/install/pypo-install.py
|
||||
|
||||
|
|
|
@ -20,6 +20,10 @@ python ${SCRIPTPATH}/../python_apps/show-recorder/install/recorder-uninstall.py
|
|||
echo -e "\n*** Uninstalling Media Monitor ***"
|
||||
python ${SCRIPTPATH}/../python_apps/media-monitor/install/media-monitor-uninstall.py
|
||||
|
||||
echo -e "\n*** Uninstalling API Client ***"
|
||||
python ${SCRIPTPATH}/../python_apps/api_clients/install/api_client_uninstall.py
|
||||
|
||||
|
||||
echo -e "\n*** Removing Pypo User ***"
|
||||
python ${SCRIPTPATH}/../python_apps/remove-pypo-user.py
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ class AirtimeIni
|
|||
const CONF_FILE_AIRTIME = "/etc/airtime/airtime.conf";
|
||||
const CONF_FILE_PYPO = "/etc/airtime/pypo.cfg";
|
||||
const CONF_FILE_RECORDER = "/etc/airtime/recorder.cfg";
|
||||
const CONF_FILE_API_CLIENT = "/etc/airtime/api_client.cfg";
|
||||
const CONF_FILE_LIQUIDSOAP = "/etc/airtime/liquidsoap.cfg";
|
||||
const CONF_FILE_MEDIAMONITOR = "/etc/airtime/media-monitor.cfg";
|
||||
const CONF_FILE_MONIT = "/etc/monit/conf.d/airtime-monit.cfg";
|
||||
|
@ -65,6 +66,10 @@ class AirtimeIni
|
|||
echo "Could not copy airtime.conf to /etc/airtime/. Exiting.";
|
||||
exit(1);
|
||||
}
|
||||
if (!copy(__DIR__."/../../python_apps/api_clients/api_client.cfg", AirtimeIni::CONF_FILE_API_CLIENT)){
|
||||
echo "Could not copy api_client.cfg to /etc/airtime/. Exiting.";
|
||||
exit(1);
|
||||
}
|
||||
if (!copy(__DIR__."/../../python_apps/pypo/pypo.cfg", AirtimeIni::CONF_FILE_PYPO)){
|
||||
echo "Could not copy pypo.cfg to /etc/airtime/. Exiting.";
|
||||
exit(1);
|
||||
|
|
|
@ -94,6 +94,8 @@ $newVersion = AIRTIME_VERSION;
|
|||
$sql = "INSERT INTO cc_pref (keystr, valstr) VALUES ('system_version', '$newVersion')";
|
||||
$CC_DBC->query($sql);
|
||||
|
||||
echo PHP_EOL."*** Updating Api Client ***".PHP_EOL;
|
||||
passthru("python ".__DIR__."/../../python_apps/api_clients/install/api_client_install.py");
|
||||
|
||||
echo PHP_EOL."*** Updating Pypo ***".PHP_EOL;
|
||||
passthru("python ".__DIR__."/../../python_apps/pypo/install/pypo-install.py");
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
bin_dir = "/usr/lib/airtime/api_clients"
|
|
@ -1,5 +1,7 @@
|
|||
import os
|
||||
import shutil
|
||||
import sys
|
||||
from configobj import ConfigObj
|
||||
|
||||
def get_current_script_dir():
|
||||
return os.path.dirname(os.path.realpath(__file__))
|
||||
|
@ -15,9 +17,9 @@ current_script_dir = get_current_script_dir()
|
|||
|
||||
"""load config file"""
|
||||
try:
|
||||
config = ConfigObj("current_script_dir/../config.cfg")
|
||||
config = ConfigObj("%s/../api_client.cfg" % current_script_dir)
|
||||
except Exception, e:
|
||||
print 'Error loading config file: ', e
|
||||
sys.exit(1)
|
||||
|
||||
copy_dir("%s/../../api_clients"%current_script_dir, config["bin_dir"]+"/api_clients/")
|
||||
copy_dir("%s/../../api_clients"%current_script_dir, config["bin_dir"])
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
import os
|
||||
import sys
|
||||
from configobj import ConfigObj
|
||||
|
||||
def remove_path(path):
|
||||
os.system('rm -rf "%s"' % path)
|
||||
|
||||
def get_current_script_dir():
|
||||
return os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
current_script_dir = get_current_script_dir()
|
||||
|
||||
"""load config file"""
|
||||
try:
|
||||
config = ConfigObj("%s/../api_client.cfg" % current_script_dir)
|
||||
except Exception, e:
|
||||
print 'Error loading config file: ', e
|
||||
sys.exit(1)
|
||||
|
||||
print "Removing API Client files"
|
||||
remove_path(config["bin_dir"])
|
|
@ -1 +0,0 @@
|
|||
bin_dir = "/usr/lib/airtime/api_clients/bin"
|
|
@ -4,7 +4,7 @@
|
|||
media_monitor_path="/usr/lib/airtime/media-monitor/"
|
||||
media_monitor_script="MediaMonitor.py"
|
||||
|
||||
api_client_path="/usr/lib/airtime/pypo/"
|
||||
api_client_path="/usr/lib/airtime/"
|
||||
cd ${media_monitor_path}
|
||||
|
||||
exec 2>&1
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
ls_user="pypo"
|
||||
export HOME="/var/tmp/airtime/pypo/"
|
||||
api_client_path="/usr/lib/airtime/pypo/"
|
||||
api_client_path="/usr/lib/airtime/"
|
||||
ls_path="/usr/lib/airtime/pypo/bin/liquidsoap_bin/liquidsoap"
|
||||
ls_param="/usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq"
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ pypo_user="pypo"
|
|||
|
||||
# Location of pypo_cli.py Python script
|
||||
pypo_path="/usr/lib/airtime/pypo/bin/"
|
||||
api_client_path="/usr/lib/airtime/pypo/"
|
||||
api_client_path="/usr/lib/airtime/"
|
||||
pypo_script="pypo-cli.py"
|
||||
cd ${pypo_path}
|
||||
exec 2>&1
|
||||
|
|
|
@ -96,7 +96,6 @@ try:
|
|||
sys.exit(1)
|
||||
|
||||
copy_dir("%s/.."%current_script_dir, config["bin_dir"]+"/bin/")
|
||||
copy_dir("%s/../../api_clients"%current_script_dir, config["bin_dir"]+"/api_clients/")
|
||||
|
||||
print "Setting permissions"
|
||||
os.system("chmod -R 755 "+config["bin_dir"])
|
||||
|
|
|
@ -7,7 +7,7 @@ recorder_user="pypo"
|
|||
recorder_path="/usr/lib/airtime/show-recorder/"
|
||||
recorder_script="recorder.py"
|
||||
|
||||
api_client_path="/usr/lib/airtime/pypo/"
|
||||
api_client_path="/usr/lib/airtime/"
|
||||
cd ${recorder_path}
|
||||
|
||||
exec 2>&1
|
||||
|
|
Loading…
Reference in New Issue