diff options
| author | Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> | 2015-04-08 11:52:50 +0200 |
|---|---|---|
| committer | Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> | 2015-04-08 11:52:50 +0200 |
| commit | dc6c9b0275ab5b8a9689b4730aeb9e7d0fd37875 (patch) | |
| tree | d7be2f0c52000756c70c265cfa152a32d493f017 /scripts | |
| parent | 797ee7fa0794f60d96fa7c5bf780853b78de2ef3 (diff) | |
| download | rabbitmq-server-git-dc6c9b0275ab5b8a9689b4730aeb9e7d0fd37875.tar.gz | |
rabbitmq-env: Prevent multiple load of the script
This doesn't happen today but it could be the case in the future, now
that the init scripts are sourcing it too.
References #88.
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/rabbitmq-env | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/rabbitmq-env b/scripts/rabbitmq-env index 7eb5545fd1..1b72c4d82c 100755 --- a/scripts/rabbitmq-env +++ b/scripts/rabbitmq-env @@ -15,6 +15,10 @@ ## Copyright (c) 2007-2014 GoPivotal, Inc. All rights reserved. ## +if [ "$RABBITMQ_ENV_LOADED" = 1 ]; then + return 0; +fi + if [ -z "$RABBITMQ_SCRIPTS_DIR" ]; then # We set +e here since since our test for "readlink -f" below needs to # be able to fail. @@ -115,5 +119,7 @@ DEFAULT_NODE_PORT=5672 ##--- End of overridden <var_name> variables +RABBITMQ_ENV_LOADED=1 + # Since we source this elsewhere, don't accidentally stop execution true |
