From 9085ec382ad6c3c83a2fa802d93f0c9977def006 Mon Sep 17 00:00:00 2001
From: Laurens <laurens@gfz-potsdam.de>
Date: Wed, 27 Jul 2022 12:35:00 +0200
Subject: [PATCH] Add VHOSTS variable to enable multiple queues

---
 files/start.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/files/start.sh b/files/start.sh
index 33e8b76..493ea80 100755
--- a/files/start.sh
+++ b/files/start.sh
@@ -12,7 +12,12 @@ rabbitmqctl add_user "$RABOTNIK_MESSAGE_BUS_USER" "$RABOTNIK_MESSAGE_BUS_PASSWOR
 rabbitmqctl set_user_tags "$RABOTNIK_MESSAGE_BUS_USER" administrator ; \
 rabbitmqctl set_permissions -p / "$RABOTNIK_MESSAGE_BUS_USER"  ".*" ".*" ".*" ; \
 echo "*** User '$RABOTNIK_MESSAGE_BUS_USER' with password '$RABOTNIK_MESSAGE_BUS_PASSWORD' completed. ***" ; \
-echo "*** Log in the WebUI at port 15672 (example: http://localhost:15672) ***") &
+echo "*** Log in the WebUI at port 15672 (example: http://localhost:15672) ***";
+for v in $RABOTNIK_MESSAGE_BUS_VHOSTS; do \
+  rabbitmqctl add_vhost $v; \
+  rabbitmqctl set_permissions -p $v "$RABOTNIK_MESSAGE_BUS_USER" ".*" ".*" ".*"; \
+  echo "*** Created vhosts '$v' ***"; \
+done) &
 
 rabbitmq-plugins enable rabbitmq_mqtt
 # $@ is used to pass arguments to the rabbitmq-server command.
-- 
GitLab