More work on base install script

This commit is contained in:
Duncan Sommerville 2014-12-11 19:16:18 -05:00
parent 369b18cb98
commit 889112ca84
1 changed files with 5 additions and 2 deletions

View File

@ -313,10 +313,13 @@ RABBITMQ_USER=$(awk -F ' = ' '{if (! ($0 ~ /^;/) && $0 ~ /^user/ ) print $2}' ${
RABBITMQ_PASSWORD=$(awk -F ' = ' '{if (! ($0 ~ /^;/) && $0 ~ /^password/ ) print $2}' ${AIRTIMEROOT}/airtime_mvc/build/airtime.example.conf)
EXCHANGES="airtime-pypo|pypo-fetch|airtime-media-monitor|media-monitor"
# Ignore errors in this check to avoid dying when vhost isn't found
set +e
rabbitmqctl list_vhosts | grep -w ${RABBITMQ_VHOST}
RESULT="$?"
set -e
# Only run these if the user doesn't exist
# Only run these if the vhost doesn't exist
if [ "${RESULT}" != "0" ]; then
verbose "\n * Creating RabbitMQ user ${RABBITMQ_USER}..."
@ -327,7 +330,7 @@ else
fi
verbose "\n * Setting RabbitMQ user permissions..."
loudCmd 'rabbitmqctl set_permissions -p ${RABBITMQ_VHOST} ${RABBITMQ_USER} "$EXCHANGES" "$EXCHANGES" "$EXCHANGES"'
loudCmd "rabbitmqctl set_permissions -p ${RABBITMQ_VHOST} ${RABBITMQ_USER} \"$EXCHANGES\" \"$EXCHANGES\" \"$EXCHANGES\""
if [ ! -d "/etc/airtime" ]; then
loud "\n-----------------------------------------------------"