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 $@
|
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 ***"
|
echo -e "\n*** Pypo Installation ***"
|
||||||
python ${SCRIPTPATH}/../python_apps/pypo/install/pypo-install.py
|
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 ***"
|
echo -e "\n*** Uninstalling Media Monitor ***"
|
||||||
python ${SCRIPTPATH}/../python_apps/media-monitor/install/media-monitor-uninstall.py
|
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 ***"
|
echo -e "\n*** Removing Pypo User ***"
|
||||||
python ${SCRIPTPATH}/../python_apps/remove-pypo-user.py
|
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_AIRTIME = "/etc/airtime/airtime.conf";
|
||||||
const CONF_FILE_PYPO = "/etc/airtime/pypo.cfg";
|
const CONF_FILE_PYPO = "/etc/airtime/pypo.cfg";
|
||||||
const CONF_FILE_RECORDER = "/etc/airtime/recorder.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_LIQUIDSOAP = "/etc/airtime/liquidsoap.cfg";
|
||||||
const CONF_FILE_MEDIAMONITOR = "/etc/airtime/media-monitor.cfg";
|
const CONF_FILE_MEDIAMONITOR = "/etc/airtime/media-monitor.cfg";
|
||||||
const CONF_FILE_MONIT = "/etc/monit/conf.d/airtime-monit.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.";
|
echo "Could not copy airtime.conf to /etc/airtime/. Exiting.";
|
||||||
exit(1);
|
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)){
|
if (!copy(__DIR__."/../../python_apps/pypo/pypo.cfg", AirtimeIni::CONF_FILE_PYPO)){
|
||||||
echo "Could not copy pypo.cfg to /etc/airtime/. Exiting.";
|
echo "Could not copy pypo.cfg to /etc/airtime/. Exiting.";
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
|
@ -94,6 +94,8 @@ $newVersion = AIRTIME_VERSION;
|
||||||
$sql = "INSERT INTO cc_pref (keystr, valstr) VALUES ('system_version', '$newVersion')";
|
$sql = "INSERT INTO cc_pref (keystr, valstr) VALUES ('system_version', '$newVersion')";
|
||||||
$CC_DBC->query($sql);
|
$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;
|
echo PHP_EOL."*** Updating Pypo ***".PHP_EOL;
|
||||||
passthru("python ".__DIR__."/../../python_apps/pypo/install/pypo-install.py");
|
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 os
|
||||||
import shutil
|
import shutil
|
||||||
|
import sys
|
||||||
|
from configobj import ConfigObj
|
||||||
|
|
||||||
def get_current_script_dir():
|
def get_current_script_dir():
|
||||||
return os.path.dirname(os.path.realpath(__file__))
|
return os.path.dirname(os.path.realpath(__file__))
|
||||||
|
@ -15,9 +17,9 @@ current_script_dir = get_current_script_dir()
|
||||||
|
|
||||||
"""load config file"""
|
"""load config file"""
|
||||||
try:
|
try:
|
||||||
config = ConfigObj("current_script_dir/../config.cfg")
|
config = ConfigObj("%s/../api_client.cfg" % current_script_dir)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print 'Error loading config file: ', e
|
print 'Error loading config file: ', e
|
||||||
sys.exit(1)
|
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_path="/usr/lib/airtime/media-monitor/"
|
||||||
media_monitor_script="MediaMonitor.py"
|
media_monitor_script="MediaMonitor.py"
|
||||||
|
|
||||||
api_client_path="/usr/lib/airtime/pypo/"
|
api_client_path="/usr/lib/airtime/"
|
||||||
cd ${media_monitor_path}
|
cd ${media_monitor_path}
|
||||||
|
|
||||||
exec 2>&1
|
exec 2>&1
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
ls_user="pypo"
|
ls_user="pypo"
|
||||||
export HOME="/var/tmp/airtime/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_path="/usr/lib/airtime/pypo/bin/liquidsoap_bin/liquidsoap"
|
||||||
ls_param="/usr/lib/airtime/pypo/bin/liquidsoap_scripts/ls_script.liq"
|
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
|
# Location of pypo_cli.py Python script
|
||||||
pypo_path="/usr/lib/airtime/pypo/bin/"
|
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"
|
pypo_script="pypo-cli.py"
|
||||||
cd ${pypo_path}
|
cd ${pypo_path}
|
||||||
exec 2>&1
|
exec 2>&1
|
||||||
|
|
|
@ -96,7 +96,6 @@ try:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
copy_dir("%s/.."%current_script_dir, config["bin_dir"]+"/bin/")
|
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"
|
print "Setting permissions"
|
||||||
os.system("chmod -R 755 "+config["bin_dir"])
|
os.system("chmod -R 755 "+config["bin_dir"])
|
||||||
|
|
|
@ -7,7 +7,7 @@ recorder_user="pypo"
|
||||||
recorder_path="/usr/lib/airtime/show-recorder/"
|
recorder_path="/usr/lib/airtime/show-recorder/"
|
||||||
recorder_script="recorder.py"
|
recorder_script="recorder.py"
|
||||||
|
|
||||||
api_client_path="/usr/lib/airtime/pypo/"
|
api_client_path="/usr/lib/airtime/"
|
||||||
cd ${recorder_path}
|
cd ${recorder_path}
|
||||||
|
|
||||||
exec 2>&1
|
exec 2>&1
|
||||||
|
|
Loading…
Reference in New Issue