diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2014-10-22 11:26:18 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2014-10-22 11:26:18 +0100 |
commit | 0f0d9e1c839d3b5c4b28aa6cceeb8e148388ec48 (patch) | |
tree | 4f3fc7893994dfd267f9040bdf7b0fcf7154a82e | |
parent | f5e1c610ccf48e00aabcf5ad3e421c91c0f5d6ba (diff) | |
download | rabbitmq-server-0f0d9e1c839d3b5c4b28aa6cceeb8e148388ec48.tar.gz |
Read the env file before figuring out USE_LONGNAME.bug26425
-rwxr-xr-x | scripts/rabbitmq-env | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/scripts/rabbitmq-env b/scripts/rabbitmq-env index 8b0e1ccd..63cfda3c 100755 --- a/scripts/rabbitmq-env +++ b/scripts/rabbitmq-env @@ -40,17 +40,6 @@ set -e SCRIPT_DIR=`dirname $SCRIPT_PATH` RABBITMQ_HOME="${SCRIPT_DIR}/.." -[ "x" = "x$RABBITMQ_USE_LONGNAME" ] && RABBITMQ_USE_LONGNAME=${USE_LONGNAME} -if [ "xtrue" = "x$RABBITMQ_USE_LONGNAME" ] ; then - RABBITMQ_NAME_TYPE=-name - [ "x" = "x$HOSTNAME" ] && HOSTNAME=`env hostname --fqdn` - NODENAME=rabbit@${HOSTNAME} -else - RABBITMQ_NAME_TYPE=-sname - [ "x" = "x$HOSTNAME" ] && HOSTNAME=`env hostname` - NODENAME=rabbit@${HOSTNAME%%.*} -fi - ## Set defaults . ${SCRIPT_DIR}/rabbitmq-defaults @@ -68,6 +57,17 @@ fi ## Get configuration variables from the configure environment file [ -f ${CONF_ENV_FILE} ] && . ${CONF_ENV_FILE} || true +[ "x" = "x$RABBITMQ_USE_LONGNAME" ] && RABBITMQ_USE_LONGNAME=${USE_LONGNAME} +if [ "xtrue" = "x$RABBITMQ_USE_LONGNAME" ] ; then + RABBITMQ_NAME_TYPE=-name + [ "x" = "x$HOSTNAME" ] && HOSTNAME=`env hostname --fqdn` + [ "x" = "x$NODENAME" ] && NODENAME=rabbit@${HOSTNAME} +else + RABBITMQ_NAME_TYPE=-sname + [ "x" = "x$HOSTNAME" ] && HOSTNAME=`env hostname` + [ "x" = "x$NODENAME" ] && NODENAME=rabbit@${HOSTNAME%%.*} +fi + ##--- Set environment vars RABBITMQ_<var_name> to defaults if not set DEFAULT_NODE_IP_ADDRESS=auto |