CC-2758: Make airtime-install script Debian/Ubuntu compatible
-uninstall script added
This commit is contained in:
parent
153e0df409
commit
56edfe4e68
15 changed files with 359 additions and 64 deletions
|
@ -37,6 +37,10 @@ except Exception, e:
|
|||
try:
|
||||
# Absolute path this script is in
|
||||
current_script_dir = get_current_script_dir()
|
||||
|
||||
#copy monit files
|
||||
shutil.copy('%s/../monit-airtime-show-recorder.cfg'%current_script_dir, '/etc/monit/conf.d/')
|
||||
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"
|
||||
|
@ -63,5 +67,3 @@ try:
|
|||
|
||||
except Exception, e:
|
||||
print e
|
||||
|
||||
|
||||
|
|
48
python_apps/show-recorder/install/recorder-remove-files.py
Normal file
48
python_apps/show-recorder/install/recorder-remove-files.py
Normal file
|
@ -0,0 +1,48 @@
|
|||
import os
|
||||
import shutil
|
||||
import sys
|
||||
from configobj import ConfigObj
|
||||
|
||||
if os.geteuid() != 0:
|
||||
print "Please run this as root."
|
||||
sys.exit(1)
|
||||
|
||||
def remove_file(path):
|
||||
try:
|
||||
os.remove(path)
|
||||
except Exception, e:
|
||||
pass
|
||||
|
||||
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:
|
||||
#remove 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"
|
||||
shutil.rmtree(config["bin_dir"])
|
||||
|
||||
#remove log dir
|
||||
print "* Removing Show-Recorder Log Directory"
|
||||
shutil.rmtree(config["log_dir"])
|
||||
|
||||
#remove temporary media-storage dir
|
||||
print "* Removing Show-Recorder Temporary Directory"
|
||||
shutil.rmtree(config["base_recorded_files"])
|
||||
|
||||
#remove 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")
|
||||
|
||||
except Exception, e:
|
||||
print "Error %s" % e
|
15
python_apps/show-recorder/install/recorder-uninitialize.py
Normal file
15
python_apps/show-recorder/install/recorder-uninitialize.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
from subprocess import Popen
|
||||
import os
|
||||
import sys
|
||||
|
||||
if os.geteuid() != 0:
|
||||
print "Please run this as root."
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
print "Waiting for show-recorder processes to stop..."
|
||||
p = Popen("/etc/init.d/airtime-show-recorder stop", shell=True)
|
||||
sts = os.waitpid(p.pid, 0)[1]
|
||||
except Exception, e:
|
||||
print e
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue