summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/rabbitmq-server10
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/rabbitmq-server b/scripts/rabbitmq-server
index 0a67e00415..7853fea2f4 100755
--- a/scripts/rabbitmq-server
+++ b/scripts/rabbitmq-server
@@ -95,7 +95,15 @@ fi
set -e
-RABBITMQ_CONFIG_FILE_NOEX="${RABBITMQ_CONFIG_FILE%.*}"
+strip_trailing_config_or_conf() {
+ local dir=$(dirname $1)
+ local filename_without_conf=$(basename $1 .conf)
+ local filename_without_config=$(basename $filename_without_conf .config)
+
+ echo "$dir/$filename_without_config"
+}
+
+RABBITMQ_CONFIG_FILE_NOEX=$(strip_trailing_config_or_conf $RABBITMQ_CONFIG_FILE)
if [ "${RABBITMQ_CONFIG_FILE_NOEX}.config" == "${RABBITMQ_CONFIG_FILE}" ]; then
if [ -f "${RABBITMQ_CONFIG_FILE}" ]; then