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
|
@ -12,7 +12,7 @@ try:
|
|||
sts = os.waitpid(p.pid, 0)[1]
|
||||
|
||||
#start daemon
|
||||
print "Waiting for show-recorder processes to start..."
|
||||
print "* Waiting for show-recorder processes to start..."
|
||||
p = Popen("/etc/init.d/airtime-show-recorder stop", shell=True)
|
||||
sts = os.waitpid(p.pid, 0)[1]
|
||||
p = Popen("/etc/init.d/airtime-show-recorder 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):
|
||||
|
@ -43,13 +43,13 @@ try:
|
|||
shutil.copy('%s/../../monit/monit-airtime-generic.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
||||
|
||||
#create temporary media-storage directory
|
||||
print "Creating temporary media storage directory"
|
||||
#print "Creating temporary media storage directory"
|
||||
create_dir(config["base_recorded_files"])
|
||||
#os.system("chmod -R 755 "+config["base_recorded_files"])
|
||||
os.system("chown -R pypo:pypo "+config["base_recorded_files"])
|
||||
|
||||
#create log directories
|
||||
print "Creating log directories"
|
||||
#print "Creating log directories"
|
||||
create_dir(config["log_dir"])
|
||||
os.system("chmod -R 755 " + config["log_dir"])
|
||||
os.system("chown -R pypo:pypo "+config["log_dir"])
|
||||
|
@ -58,7 +58,7 @@ try:
|
|||
copy_dir("%s/.."%current_script_dir, config["bin_dir"])
|
||||
|
||||
#set python file permissions
|
||||
print "Setting permissions"
|
||||
#print "Setting permissions"
|
||||
os.system("chmod -R 755 "+config["bin_dir"])
|
||||
os.system("chown -R pypo:pypo "+config["bin_dir"])
|
||||
|
||||
|
|
|
@ -24,23 +24,23 @@ except Exception, e:
|
|||
|
||||
try:
|
||||
#remove init.d script
|
||||
print "* Removing Show-Recorder init.d script"
|
||||
print " * Removing Show-Recorder init.d script"
|
||||
remove_file('/etc/init.d/airtime-show-recorder')
|
||||
|
||||
#remove bin dir
|
||||
print "* Removing Show-Recorder Program Directories"
|
||||
print " * Removing Show-Recorder Program Directories"
|
||||
shutil.rmtree(config["bin_dir"], ignore_errors=True)
|
||||
|
||||
#remove log dir
|
||||
print "* Removing Show-Recorder Log Directory"
|
||||
print " * Removing Show-Recorder Log Directory"
|
||||
shutil.rmtree(config["log_dir"], ignore_errors=True)
|
||||
|
||||
#remove temporary media-storage dir
|
||||
print "* Removing Show-Recorder Temporary Directory"
|
||||
print " * Removing Show-Recorder Temporary Directory"
|
||||
shutil.rmtree(config["base_recorded_files"], ignore_errors=True)
|
||||
|
||||
#remove monit files
|
||||
print "* Removing Show-Recorder Monit Files"
|
||||
print " * Removing Show-Recorder Monit Files"
|
||||
remove_file("/etc/monit/conf.d/monit-airtime-show-recorder.cfg")
|
||||
remove_file("/etc/monit/conf.d/monit-airtime-generic.cfg")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue