chore(script): make emqx_ctl work with docker entrypoint

This commit is contained in:
Zaiming Shi 2021-03-23 15:22:37 +01:00 committed by Rory Z
parent 3ea8039d90
commit 78afdd8b57
1 changed files with 2 additions and 0 deletions

View File

@ -34,6 +34,8 @@ relx_nodetool() {
if [ -z "$NAME_ARG" ]; then
NODENAME="${EMQX_NODE_NAME:-}"
# compatible with docker entrypoint
[ -z "$NODENAME" ] && [ -n "$EMQX_NAME" ] && [ -n "$EMQX_HOST" ] && NODENAME="${EMQX_NAME}@${EMQX_HOST}"
[ -z "$NODENAME" ] && NODENAME=$(grep -E '^[ \t]*node.name[ \t]*=[ \t]*' "$RUNNER_ETC_DIR/emqx.conf" 2> /dev/null | tail -1 | cut -d = -f 2-)
if [ -z "$NODENAME" ]; then
echoerr "vm.args needs to have a -name parameter."