CC-5005: airtime-purge doesn't remove all files
-cleanup
This commit is contained in:
parent
2ba39bddf0
commit
8e314477c7
6 changed files with 10 additions and 80 deletions
|
@ -208,8 +208,6 @@ if [ "$mediamonitor" = "t" -o "$pypo" = "t" ]; then
|
|||
fi
|
||||
|
||||
|
||||
/usr/lib/airtime/utils/rabbitmq-update-pid.sh > /dev/null
|
||||
|
||||
touch /usr/share/airtime/public/index.php
|
||||
|
||||
if [ "$python_service" -eq "0" ]; then
|
||||
|
|
|
@ -57,7 +57,6 @@ invoke-rc.d monit restart
|
|||
sleep 1
|
||||
|
||||
set +e
|
||||
|
||||
if [ "$mediamonitor" = "t" ]; then
|
||||
monit monitor airtime-media-monitor
|
||||
fi
|
||||
|
@ -65,6 +64,4 @@ if [ "$pypo" = "t" ]; then
|
|||
monit monitor airtime-playout
|
||||
monit monitor airtime-liquidsoap
|
||||
fi
|
||||
|
||||
monit monitor rabbitmq-server
|
||||
set -e
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
#!/bin/bash
|
||||
#-e Causes bash script to exit if any of the installers
|
||||
#return with a non-zero return value.
|
||||
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
echo "Please run as root user."
|
||||
|
@ -20,17 +18,9 @@ SCRIPTPATH=`dirname $SCRIPT`
|
|||
|
||||
AIRTIMEROOT=$SCRIPTPATH/../../
|
||||
|
||||
#rm -f /etc/airtime/airtime.conf
|
||||
#rm -f /etc/airtime/api_client.cfg
|
||||
#rm -f /etc/airtime/recorder.cfg
|
||||
#rm -f /etc/airtime/media-monitor.cfg
|
||||
#rm -f /etc/airtime/pypo.cfg
|
||||
#rm -f /etc/airtime/liquidsoap.cfg
|
||||
|
||||
rm -f /etc/cron.d/airtime-crons
|
||||
|
||||
#virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
|
||||
#. ${virtualenv_bin}activate
|
||||
rm -f /etc/monit/conf.d/monit-airtime*
|
||||
rm -f /etc/logrotate.d/airtime-php
|
||||
|
||||
echo "* API Client"
|
||||
python $AIRTIMEROOT/python_apps/api_clients/install/api_client_uninstall.py
|
||||
|
@ -38,8 +28,6 @@ echo "* Pypo"
|
|||
python $AIRTIMEROOT/python_apps/pypo/install/pypo-remove-files.py
|
||||
echo "* Media-Monitor"
|
||||
python $AIRTIMEROOT/python_apps/media-monitor/install/media-monitor-remove-files.py
|
||||
#echo "* Show-Recorder"
|
||||
#python $AIRTIMEROOT/python_apps/show-recorder/install/recorder-remove-files.py
|
||||
|
||||
#remove symlinks
|
||||
rm -f /usr/bin/airtime-import
|
||||
|
|
|
@ -13,5 +13,7 @@ try:
|
|||
print "OK"
|
||||
else:
|
||||
print "Wasn't running"
|
||||
|
||||
subprocess.call("update-rc.d -f airtime-media-monitor remove".split(" "))
|
||||
except Exception, e:
|
||||
print e
|
||||
|
|
|
@ -25,5 +25,9 @@ try:
|
|||
print "OK"
|
||||
else:
|
||||
print "Wasn't running"
|
||||
|
||||
subprocess.call("update-rc.d -f airtime-playout remove".split(" "))
|
||||
subprocess.call("update-rc.d -f airtime-liquidsoap remove".split(" "))
|
||||
|
||||
except Exception, e:
|
||||
print e
|
||||
|
|
|
@ -1,59 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
import os
|
||||
import sys
|
||||
from configobj import ConfigObj
|
||||
|
||||
if os.geteuid() != 0:
|
||||
print "Please run this as root."
|
||||
sys.exit(1)
|
||||
|
||||
PATH_INI_FILE = '/etc/airtime/pypo.cfg'
|
||||
|
||||
def remove_path(path):
|
||||
os.system('rm -rf "%s"' % path)
|
||||
|
||||
def get_current_script_dir():
|
||||
current_script_dir = os.path.realpath(__file__)
|
||||
index = current_script_dir.rindex('/')
|
||||
return current_script_dir[0:index]
|
||||
|
||||
def remove_monit_file():
|
||||
os.system("rm -f /etc/monit/conf.d/monit-airtime-playout.cfg")
|
||||
os.system("rm -f /etc/monit/conf.d/monit-airtime-liquidsoap.cfg")
|
||||
|
||||
try:
|
||||
# load config file
|
||||
try:
|
||||
config = ConfigObj(PATH_INI_FILE)
|
||||
except Exception, e:
|
||||
print 'Error loading config file: ', e
|
||||
sys.exit(1)
|
||||
|
||||
os.system("invoke-rc.d airtime-playout stop")
|
||||
os.system("invoke-rc.d airtime-liquidsoap stop")
|
||||
|
||||
os.system("rm -f /etc/init.d/airtime-playout")
|
||||
os.system("rm -f /etc/init.d/airtime-liquidsoap")
|
||||
|
||||
os.system("update-rc.d -f airtime-playout remove >/dev/null 2>&1")
|
||||
os.system("update-rc.d -f airtime-liquidsoap remove >/dev/null 2>&1")
|
||||
|
||||
#remove logrotate script
|
||||
os.system("rm -f /etc/logrotate.d/airtime-liquidsoap")
|
||||
|
||||
print "Removing monit file"
|
||||
remove_monit_file()
|
||||
|
||||
print "Removing cache directories"
|
||||
remove_path(config["cache_base_dir"])
|
||||
|
||||
print "Removing symlinks"
|
||||
os.system("rm -f /usr/bin/airtime-liquidsoap")
|
||||
|
||||
print "Removing pypo files"
|
||||
remove_path(config["bin_dir"])
|
||||
|
||||
print "Pypo uninstall complete."
|
||||
except Exception, e:
|
||||
print "exception:" + str(e)
|
Loading…
Add table
Add a link
Reference in a new issue