From 19a18171590d6e60384bc13893a19ce4e75793e8 Mon Sep 17 00:00:00 2001 From: Duncan Sommerville Date: Thu, 15 Jan 2015 10:12:52 -0500 Subject: [PATCH] Fix a bad reversion in the airtime-playout binary --- install | 6 +++--- python_apps/pypo/bin/airtime-playout | 2 +- uninstall | 24 +++++++++++++++++++----- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/install b/install index 37c930f66..e1ec9ef6e 100755 --- a/install +++ b/install @@ -497,9 +497,9 @@ loud "-----------------------------------------------------" loudCmd "apt-get -y --force-yes install rabbitmq-server" -RABBITMQ_VHOST=$(awk -F ' = ' '{if (! ($0 ~ /^;/) && $0 ~ /^vhost/ ) print $2}' ${AIRTIMEROOT}/airtime_mvc/build/airtime.example.conf) -RABBITMQ_USER=$(awk -F ' = ' '{if (! ($0 ~ /^;/) && $0 ~ /^user/ ) print $2}' ${AIRTIMEROOT}/airtime_mvc/build/airtime.example.conf) -RABBITMQ_PASSWORD=$(awk -F ' = ' '{if (! ($0 ~ /^;/) && $0 ~ /^password/ ) print $2}' ${AIRTIMEROOT}/airtime_mvc/build/airtime.example.conf) +RABBITMQ_VHOST=/airtime +RABBITMQ_USER=airtime +RABBITMQ_PASSWORD=airtime EXCHANGES="airtime-pypo|pypo-fetch|airtime-media-monitor|media-monitor" # Ignore errors in this check to avoid dying when vhost isn't found diff --git a/python_apps/pypo/bin/airtime-playout b/python_apps/pypo/bin/airtime-playout index affc31e22..4326e45dc 100755 --- a/python_apps/pypo/bin/airtime-playout +++ b/python_apps/pypo/bin/airtime-playout @@ -13,4 +13,4 @@ export PYTHONPATH=/usr/lib/airtime/:/usr/lib/airtime/pypo/bin/:/usr/lib/airtime/ export LC_ALL=`cat /etc/default/locale | grep "LANG=" | cut -d= -f2 | tr -d "\n\""` export TERM=xterm -exec python ${pypo_path}/pypocli.py > /var/log/airtime/pypo/py-interpreter.log 2>&1 +exec python /usr/lib/airtime/pypo/bin/pypocli.py > /var/log/airtime/pypo/py-interpreter.log 2>&1 diff --git a/uninstall b/uninstall index ccc21aa04..e2c93f344 100755 --- a/uninstall +++ b/uninstall @@ -30,6 +30,14 @@ dropAirtimeDatabase() { EOF } +removeRabbitmqAirtimeSettings() { + 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) + + rabbitmqctl delete_vhost ${RMQ_VHOST} + rabbitmqctl delete_user ${RMQ_USER} +} + SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" AIRTIMEROOT=${SCRIPT_DIR} @@ -61,13 +69,19 @@ if [[ ! ( "$IN" = "y" || "$IN" = "Y" ) ]]; then exit 0 fi -echo -e "\nAre you sure you want to remove your music storage directory ${STOR_DIR} and all of its subdirectories? (Y/n): \c" -read IN -if [[ "$IN" = "y" || "$IN" = "Y" ]]; then - rm -rf ${STOR_DIR} +if [ -n ${STOR_DIR} ]; then + echo -e "\nAre you sure you want to remove your music storage directory ${STOR_DIR} and all of its subdirectories? (Y/n): \c" + read IN + if [[ "$IN" = "y" || "$IN" = "Y" ]]; then + rm -rf ${STOR_DIR} + fi +else + echo -e "\nNo stor directory found, skipping..." fi -echo "Uninstalling Airtime..." +echo -e "\nUninstalling Airtime..." +removeRabbitmqAirtimeSettings + rm -rf /etc/airtime rm -rf /var/log/airtime/ rm -rf /usr/lib/airtime/