SAAS-83: Add ability to install Airtime components separately
-fixed
This commit is contained in:
parent
f75d216bae
commit
15a27526f9
9 changed files with 80 additions and 52 deletions
|
@ -12,8 +12,13 @@ def copy_dir(src_dir, dest_dir):
|
|||
if not (os.path.exists(dest_dir)):
|
||||
#print "Copying directory "+os.path.realpath(src_dir)+" to "+os.path.realpath(dest_dir)
|
||||
shutil.copytree(src_dir, dest_dir)
|
||||
|
||||
PATH_INI_FILE = '/etc/airtime/api_client.cfg'
|
||||
|
||||
current_script_dir = get_current_script_dir()
|
||||
|
||||
if not os.path.exists(PATH_INI_FILE):
|
||||
shutil.copy('%s/../api_client.cfg'%current_script_dir, PATH_INI_FILE)
|
||||
|
||||
"""load config file"""
|
||||
try:
|
||||
|
|
|
@ -27,17 +27,20 @@ def create_dir(path):
|
|||
|
||||
PATH_INI_FILE = '/etc/airtime/media-monitor.cfg'
|
||||
|
||||
# load config file
|
||||
try:
|
||||
config = ConfigObj(PATH_INI_FILE)
|
||||
except Exception, e:
|
||||
print 'Error loading config file: ', e
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
# Absolute path this script is in
|
||||
current_script_dir = get_current_script_dir()
|
||||
|
||||
if not os.path.exists(PATH_INI_FILE):
|
||||
shutil.copy('%s/../media-monitor.cfg'%current_script_dir, PATH_INI_FILE)
|
||||
|
||||
# load config file
|
||||
try:
|
||||
config = ConfigObj(PATH_INI_FILE)
|
||||
except Exception, e:
|
||||
print 'Error loading config file: ', e
|
||||
sys.exit(1)
|
||||
|
||||
#copy monit files
|
||||
shutil.copy('%s/../monit-airtime-media-monitor.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
||||
shutil.copy('%s/../../monit/monit-airtime-generic.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
||||
|
|
|
@ -8,7 +8,7 @@ if os.geteuid() != 0:
|
|||
|
||||
try:
|
||||
print "Waiting for media-monitor processes to stop...",
|
||||
if (os.path.exists('/etc/init.d/airtime-playout')):
|
||||
if (os.path.exists('/etc/init.d/airtime-media-monitor')):
|
||||
p = Popen("/etc/init.d/airtime-media-monitor stop", shell=True)
|
||||
sts = os.waitpid(p.pid, 0)[1]
|
||||
print "OK"
|
||||
|
|
|
@ -27,17 +27,20 @@ def create_dir(path):
|
|||
|
||||
PATH_INI_FILE = '/etc/airtime/pypo.cfg'
|
||||
|
||||
# load config file
|
||||
try:
|
||||
config = ConfigObj(PATH_INI_FILE)
|
||||
except Exception, e:
|
||||
print 'Error loading config file: ', e
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
try:
|
||||
# Absolute path this script is in
|
||||
current_script_dir = get_current_script_dir()
|
||||
|
||||
if not os.path.exists(PATH_INI_FILE):
|
||||
shutil.copy('%s/../pypo.cfg'%current_script_dir, PATH_INI_FILE)
|
||||
|
||||
# load config file
|
||||
try:
|
||||
config = ConfigObj(PATH_INI_FILE)
|
||||
except Exception, e:
|
||||
print 'Error loading config file: ', e
|
||||
sys.exit(1)
|
||||
|
||||
#copy monit files
|
||||
shutil.copy('%s/../monit-airtime-playout.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
||||
shutil.copy('%s/../monit-airtime-liquidsoap.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
||||
|
|
|
@ -27,16 +27,20 @@ def create_dir(path):
|
|||
|
||||
PATH_INI_FILE = '/etc/airtime/recorder.cfg'
|
||||
|
||||
# load config file
|
||||
try:
|
||||
config = ConfigObj(PATH_INI_FILE)
|
||||
except Exception, e:
|
||||
print 'Error loading config file: ', e
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
# Absolute path this script is in
|
||||
current_script_dir = get_current_script_dir()
|
||||
|
||||
if not os.path.exists(PATH_INI_FILE):
|
||||
shutil.copy('%s/../recorder.cfg'%current_script_dir, PATH_INI_FILE)
|
||||
|
||||
# load config file
|
||||
try:
|
||||
config = ConfigObj(PATH_INI_FILE)
|
||||
except Exception, e:
|
||||
print 'Error loading config file: ', e
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
#copy monit files
|
||||
shutil.copy('%s/../monit-airtime-show-recorder.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
||||
|
|
|
@ -8,7 +8,7 @@ if os.geteuid() != 0:
|
|||
|
||||
try:
|
||||
print "Waiting for show-recorder processes to stop...",
|
||||
if (os.path.exists('/etc/init.d/airtime-playout')):
|
||||
if (os.path.exists('/etc/init.d/airtime-show-recorder')):
|
||||
p = Popen("/etc/init.d/airtime-show-recorder stop", shell=True)
|
||||
sts = os.waitpid(p.pid, 0)[1]
|
||||
print "OK"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue