summaryrefslogtreecommitdiff
path: root/scripts/rabbitmq-env
diff options
context:
space:
mode:
authorMichael Klishin <michael@novemberain.com>2016-11-29 15:29:57 +0300
committerGitHub <noreply@github.com>2016-11-29 15:29:57 +0300
commitb907d34689879da7e9f2f4991d61e344a48cce30 (patch)
treebe201bd9e72908cb83dce452a8a450fc62209560 /scripts/rabbitmq-env
parentb2141bde48add4f3281e5667c8d7835dbd62601a (diff)
parenta31bb2e166229230b91a88ce206dae046d2c158c (diff)
downloadrabbitmq-server-git-b907d34689879da7e9f2f4991d61e344a48cce30.tar.gz
Merge pull request #1042 from rabbitmq/rabbitmq-server-1040
Add background GC settings to new config format
Diffstat (limited to 'scripts/rabbitmq-env')
-rwxr-xr-xscripts/rabbitmq-env26
1 files changed, 20 insertions, 6 deletions
diff --git a/scripts/rabbitmq-env b/scripts/rabbitmq-env
index f1962e2b7b..d975f274b2 100755
--- a/scripts/rabbitmq-env
+++ b/scripts/rabbitmq-env
@@ -57,6 +57,20 @@ rmq_realpath() {
fi
}
+path_contains_existing_directory() {
+ local path="${1:?}"
+ local dir
+ local rc
+ local IFS="
+ "
+ for dir in $(echo "$path" | tr ':' '\n'); do
+ if [ -d "$dir" ]; then
+ return 0
+ fi
+ done
+ return 1
+}
+
RABBITMQ_HOME="$(rmq_realpath "${RABBITMQ_SCRIPTS_DIR}/..")"
ESCRIPT_DIR="${RABBITMQ_HOME}/escript"
@@ -108,8 +122,9 @@ fi
rmq_normalize_path() {
local path=$1
- # Remove redundant slashes and strip a trailing slash
- echo "$path" | sed -e 's#/\{2,\}#/#g' -e 's#/$##'
+ # Remove redundant slashes and strip a trailing slash for a
+ # PATH-like vars - ':' is the delimiter
+ echo "$path" | sed -e 's#/\{2,\}#/#g' -e 's#/$##' -e 's#/:#:#g'
}
rmq_normalize_path_var() {
@@ -265,9 +280,8 @@ if [ "${RABBITMQ_DEV_ENV}" ]; then
RABBITMQ_ENABLED_PLUGINS_FILE="${enabled_plugins_file}"
fi
fi
-
-
- if [ -d "${RABBITMQ_PLUGINS_DIR}" ]; then
+
+ if path_contains_existing_directory "${RABBITMQ_PLUGINS_DIR}" ; then
# RabbitMQ was started with "make run-broker" from its own
# source tree. Take rabbit_common from the plugins directory.
ERL_LIBS="${RABBITMQ_PLUGINS_DIR}:${ERL_LIBS}"
@@ -291,7 +305,7 @@ if [ "${RABBITMQ_DEV_ENV}" ]; then
ERL_LIBS="${DEPS_DIR_norm}:${ERL_LIBS}"
fi
else
- if [ -d "${RABBITMQ_PLUGINS_DIR}" ]; then
+ if path_contains_existing_directory "${RABBITMQ_PLUGINS_DIR}" ; then
# RabbitMQ was started from its install directory. Take
# rabbit_common from the plugins directory.
ERL_LIBS="${RABBITMQ_PLUGINS_DIR}:${ERL_LIBS}"