Merge pull request #1080 from paddatrapper/uninstall

Rename Airtime to LibreTime in Uninstall script
This commit is contained in:
Robb 2020-08-13 10:07:22 -04:00 committed by GitHub
commit 5ac18aa4e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 10 deletions

View File

@ -18,7 +18,7 @@ EOF`
echo $result
}
dropAirtimeDatabase() {
dropLibreTimeDatabase() {
# here-doc to execute this block as postgres user
su postgres <<'EOF'
set +e
@ -31,7 +31,7 @@ dropAirtimeDatabase() {
EOF
}
removeRabbitmqAirtimeSettings() {
removeRabbitmqLibreTimeSettings() {
if [ -f /etc/airtime/airtime.conf ]; then
RMQ_VHOST=$(awk -F ' = ' '{if (! ($0 ~ /^;/) && $0 ~ /^vhost/ ) print $2}' /etc/airtime/airtime.conf)
RMQ_USER=$(awk -F ' = ' '{if (! ($0 ~ /^;/) && $0 ~ /^user/ ) print $2}' /etc/airtime/airtime.conf)
@ -55,6 +55,7 @@ FILES=(
"/usr/lib/airtime"
"/usr/share/airtime"
"/etc/init/airtime*"
"/etc/systemd/system/libretime*"
"/usr/local/bin/airtime-*"
"/usr/bin/airtime*"
"/etc/apache2/sites-available/airtime*"
@ -69,8 +70,8 @@ echo "pip3 airtime-playout"
echo -e "\nIf your web root is not listed, you will need to manually remove it."
echo -e "\nThis will *permanently* remove Airtime and all related files from your computer. \
Any files in Airtime directories and subdirectories will be deleted. Are you sure you want to proceed? [y/N]: \c"
echo -e "\nThis will *permanently* remove LibreTime and all related files from your computer. \
Any files in LibreTime directories and subdirectories will be deleted. Are you sure you want to proceed? [y/N]: \c"
read IN
if [[ ! ( "$IN" = "y" || "$IN" = "Y" ) ]]; then
exit 0
@ -86,21 +87,21 @@ else
echo -e "\nNo stor directory found, skipping..."
fi
echo -e "\nUninstalling Airtime..."
service airtime-celery stop
echo -e "\nUninstalling LibreTime..."
systemctl stop libretime-celery
set +e
removeRabbitmqAirtimeSettings
removeRabbitmqLibreTimeSettings
set -e
for i in ${FILES[*]}; do
rm -rf $i
done
echo -e "\nDo you want to drop your current Airtime database? [y/N]: \c"
echo -e "\nDo you want to drop your current LibreTime database? [y/N]: \c"
read IN
if [[ "$IN" = "y" || "$IN" = "Y" ]]; then
echo -e "\nDropping Airtime database..."
dropAirtimeDatabase
echo -e "\nDropping LibreTime database..."
dropLibreTimeDatabase
fi
pip3 uninstall -y airtime-playout airtime-media-monitor airtime-analyzer