CC-2758: Make airtime-install script Debian/Ubuntu compatible
-cosmetic changes
This commit is contained in:
parent
d2f4e55dd6
commit
f2ef006385
17 changed files with 67 additions and 51 deletions
|
@ -70,17 +70,19 @@ try:
|
|||
architecture = platform.architecture()[0]
|
||||
natty = is_natty()
|
||||
|
||||
print "* Detecting system architecture for Liquidsoap"
|
||||
|
||||
if architecture == '64bit' and natty:
|
||||
print "Installing 64-bit liquidsoap binary (Natty)"
|
||||
print " * Installing 64-bit liquidsoap binary (Natty)"
|
||||
shutil.copy("%s/../liquidsoap_bin/liquidsoap-natty-amd64"%current_script_dir, "%s/../liquidsoap_bin/liquidsoap"%current_script_dir)
|
||||
elif architecture == '32bit' and natty:
|
||||
print "Installing 32-bit liquidsoap binary (Natty)"
|
||||
print " * Installing 32-bit liquidsoap binary (Natty)"
|
||||
shutil.copy("%s/../liquidsoap_bin/liquidsoap-natty-i386"%current_script_dir, "%s/../liquidsoap_bin/liquidsoap"%current_script_dir)
|
||||
elif architecture == '64bit' and not natty:
|
||||
print "Installing 64-bit liquidsoap binary"
|
||||
print " * Installing 64-bit liquidsoap binary"
|
||||
shutil.copy("%s/../liquidsoap_bin/liquidsoap-amd64"%current_script_dir, "%s/../liquidsoap_bin/liquidsoap"%current_script_dir)
|
||||
elif architecture == '32bit' and not natty:
|
||||
print "Installing 32-bit liquidsoap binary"
|
||||
print " * Installing 32-bit liquidsoap binary"
|
||||
shutil.copy("%s/../liquidsoap_bin/liquidsoap-i386"%current_script_dir, "%s/../liquidsoap_bin/liquidsoap"%current_script_dir)
|
||||
else:
|
||||
print "Unknown system architecture."
|
||||
|
@ -101,7 +103,7 @@ try:
|
|||
print "Unable to connect to the Airtime server."
|
||||
|
||||
#restart airtime-playout
|
||||
print "Waiting for pypo processes to start..."
|
||||
print "* Waiting for pypo processes to start..."
|
||||
p = Popen("/etc/init.d/airtime-playout stop", shell=True)
|
||||
sts = os.waitpid(p.pid, 0)[1]
|
||||
p = Popen("/etc/init.d/airtime-playout start-no-monit", shell=True)
|
||||
|
|
|
@ -16,7 +16,7 @@ def copy_dir(src_dir, dest_dir):
|
|||
if (os.path.exists(dest_dir)) and (dest_dir != "/"):
|
||||
shutil.rmtree(dest_dir)
|
||||
if not (os.path.exists(dest_dir)):
|
||||
print "Copying directory "+os.path.realpath(src_dir)+" to "+os.path.realpath(dest_dir)
|
||||
#print "Copying directory "+os.path.realpath(src_dir)+" to "+os.path.realpath(dest_dir)
|
||||
shutil.copytree(src_dir, dest_dir)
|
||||
|
||||
def create_dir(path):
|
||||
|
|
|
@ -24,27 +24,27 @@ except Exception, e:
|
|||
|
||||
try:
|
||||
#remove log rotate script
|
||||
print "* Removing Pypo Log Rotate Script"
|
||||
print " * Removing Pypo Log Rotate Script"
|
||||
remove_file("/etc/logrotate.d/airtime-liquidsoap")
|
||||
|
||||
#remove init.d script
|
||||
print "* Removing Pypo init.d Script"
|
||||
print " * Removing Pypo init.d Script"
|
||||
remove_file("/etc/init.d/airtime-playout")
|
||||
|
||||
#remove bin, cache, tmp and file dir
|
||||
print "* Removing Pypo Program directories"
|
||||
print " * Removing Pypo Program directories"
|
||||
shutil.rmtree(config['bin_dir'], ignore_errors=True)
|
||||
shutil.rmtree(config['cache_dir'], ignore_errors=True)
|
||||
shutil.rmtree(config['file_dir'], ignore_errors=True)
|
||||
shutil.rmtree(config['tmp_dir'], ignore_errors=True)
|
||||
|
||||
#remove liquidsoap and pypo log dir
|
||||
print "* Removing Pypo Log Directories"
|
||||
print " * Removing Pypo Log Directories"
|
||||
shutil.rmtree(config['liquidsoap_log_dir'], ignore_errors=True)
|
||||
shutil.rmtree(config['pypo_log_dir'], ignore_errors=True)
|
||||
|
||||
#remove monit files
|
||||
print "* Removing Pypo Monit Files"
|
||||
print " * Removing Pypo Monit Files"
|
||||
remove_file("/etc/monit/conf.d/monit-airtime-playout.cfg")
|
||||
remove_file("/etc/monit/conf.d/monit-airtime-liquidsoap.cfg")
|
||||
remove_file("/etc/monit/conf.d/monit-airtime-generic.cfg")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue