From 679a3ce7beec5476eb7ac45fd814e5f790b0dbfb Mon Sep 17 00:00:00 2001 From: Stig Sandbeck Mathisen Date: Sun, 5 Oct 2014 20:12:44 +0200 Subject: [PATCH] Check if we are running as a user required by rabbitmqctl --- plugins/rabbitmq/rabbitmq_connections | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/rabbitmq/rabbitmq_connections b/plugins/rabbitmq/rabbitmq_connections index 9b943b93..89a6a4f7 100755 --- a/plugins/rabbitmq/rabbitmq_connections +++ b/plugins/rabbitmq/rabbitmq_connections @@ -42,6 +42,16 @@ Optional, default value is 1000 =cut +case $(whoami) in + rabbitmq|root) + ;; + *) + echo 'Error: Plugin requires "user" to be set in plugin configuration.' >&2 + echo 'See "munindoc rabbitmq_connections" for more information' >&2 + exit 1 + ;; +esac + # If run with the "config"-parameter, give out information on how the # graphs should look.