From 78225e4d04ac48205934ed6d25f274d4cc28e2ce Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Fri, 3 Aug 2018 00:14:47 +0000 Subject: [PATCH] configure-rabbitmq: Fix shellcheck warnings. In scripts/setup/configure-rabbitmq line 13: sudo rabbitmqctl $RABBITMQ_FLAGS delete_user "$RABBITMQ_USERNAME" || true ^-- SC2086: Double quote to prevent globbing and word splitting. In scripts/setup/configure-rabbitmq line 14: sudo rabbitmqctl $RABBITMQ_FLAGS delete_user zulip || true ^-- SC2086: Double quote to prevent globbing and word splitting. In scripts/setup/configure-rabbitmq line 15: sudo rabbitmqctl $RABBITMQ_FLAGS delete_user guest || true ^-- SC2086: Double quote to prevent globbing and word splitting. In scripts/setup/configure-rabbitmq line 16: sudo rabbitmqctl $RABBITMQ_FLAGS add_user "$RABBITMQ_USERNAME" "$RABBITMQ_PASSWORD" ^-- SC2086: Double quote to prevent globbing and word splitting. In scripts/setup/configure-rabbitmq line 17: sudo rabbitmqctl $RABBITMQ_FLAGS set_user_tags "$RABBITMQ_USERNAME" administrator ^-- SC2086: Double quote to prevent globbing and word splitting. In scripts/setup/configure-rabbitmq line 18: sudo rabbitmqctl $RABBITMQ_FLAGS set_permissions -p / "$RABBITMQ_USERNAME" '.*' '.*' '.*' ^-- SC2086: Double quote to prevent globbing and word splitting. Signed-off-by: Anders Kaseorg --- scripts/setup/configure-rabbitmq | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/setup/configure-rabbitmq b/scripts/setup/configure-rabbitmq index ff40e59c28..e2685fa9f8 100755 --- a/scripts/setup/configure-rabbitmq +++ b/scripts/setup/configure-rabbitmq @@ -5,14 +5,15 @@ set -e set -x +RABBITMQ_FLAGS=() if [ -n "$RABBITMQ_NODE" ]; then - RABBITMQ_FLAGS="-n $RABBITMQ_NODE" + RABBITMQ_FLAGS=(-n "$RABBITMQ_NODE") fi RABBITMQ_USERNAME=$("$(dirname "$0")/../get-django-setting" RABBITMQ_USERNAME) RABBITMQ_PASSWORD=$("$(dirname "$0")/../get-django-setting" RABBITMQ_PASSWORD) -sudo rabbitmqctl $RABBITMQ_FLAGS delete_user "$RABBITMQ_USERNAME" || true -sudo rabbitmqctl $RABBITMQ_FLAGS delete_user zulip || true -sudo rabbitmqctl $RABBITMQ_FLAGS delete_user guest || true -sudo rabbitmqctl $RABBITMQ_FLAGS add_user "$RABBITMQ_USERNAME" "$RABBITMQ_PASSWORD" -sudo rabbitmqctl $RABBITMQ_FLAGS set_user_tags "$RABBITMQ_USERNAME" administrator -sudo rabbitmqctl $RABBITMQ_FLAGS set_permissions -p / "$RABBITMQ_USERNAME" '.*' '.*' '.*' +sudo rabbitmqctl "${RABBITMQ_FLAGS[@]}" delete_user "$RABBITMQ_USERNAME" || true +sudo rabbitmqctl "${RABBITMQ_FLAGS[@]}" delete_user zulip || true +sudo rabbitmqctl "${RABBITMQ_FLAGS[@]}" delete_user guest || true +sudo rabbitmqctl "${RABBITMQ_FLAGS[@]}" add_user "$RABBITMQ_USERNAME" "$RABBITMQ_PASSWORD" +sudo rabbitmqctl "${RABBITMQ_FLAGS[@]}" set_user_tags "$RABBITMQ_USERNAME" administrator +sudo rabbitmqctl "${RABBITMQ_FLAGS[@]}" set_permissions -p / "$RABBITMQ_USERNAME" '.*' '.*' '.*'