From d4c6b6b92603593563ce7e00b99be68b0abca10e Mon Sep 17 00:00:00 2001 From: Zaiming Shi Date: Mon, 29 Mar 2021 09:23:42 +0200 Subject: [PATCH] chore(scripts): ensure no space in cookie --- bin/emqx | 6 +++--- bin/emqx_ctl | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/emqx b/bin/emqx index 53b906d32..68639b113 100755 --- a/bin/emqx +++ b/bin/emqx @@ -290,7 +290,7 @@ if [ -z "$NAME_ARG" ]; then NODENAME="$(grep -E '^-name' "$LATEST_VM_ARGS" | awk '{print $2}')" else # for boot commands, inspect emqx.conf for node name - NODENAME=$(grep -E '^[ \t]*node.name[ \t]*=[ \t]*' "$RUNNER_ETC_DIR/emqx.conf" 2> /dev/null | tail -1 | cut -d = -f 2-) + NODENAME=$(grep -E '^[ \t]*node.name[ \t]*=[ \t]*' "$RUNNER_ETC_DIR/emqx.conf" 2> /dev/null | tail -1 | awk -F"= " '{print $NF}') fi fi if [ -z "$NODENAME" ]; then @@ -316,7 +316,7 @@ PIPE_DIR="${PIPE_DIR:-/$RUNNER_DATA_DIR/${WHOAMI}_erl_pipes/$NAME/}" COOKIE="${EMQX_NODE_COOKIE:-}" if [ -z "$COOKIE" ]; then if [ "$IS_BOOT_COMMAND" = 'yes' ]; then - COOKIE=$(grep -E '^[ \t]*node.cookie[ \t]*=[ \t]*' "$RUNNER_ETC_DIR/emqx.conf" 2> /dev/null | tail -1 | cut -d = -f 2-) + COOKIE=$(grep -E '^[ \t]*node.cookie[ \t]*=[ \t]*' "$RUNNER_ETC_DIR/emqx.conf" 2> /dev/null | tail -1 | awk -F"= " '{print $NF}') else # shellcheck disable=SC2012,SC2086 LATEST_VM_ARGS="$(ls -t $RUNNER_DATA_DIR/configs/vm.*.args | head -1)" @@ -334,7 +334,7 @@ if [ -z "$COOKIE" ]; then fi # Support for IPv6 Dist. See: https://github.com/emqtt/emqttd/issues/1460 -PROTO_DIST=$(grep -E '^[ \t]*cluster.proto_dist[ \t]*=[ \t]*' "$RUNNER_ETC_DIR/emqx.conf" 2> /dev/null | tail -1 | cut -d = -f 2-) +PROTO_DIST=$(grep -E '^[ \t]*cluster.proto_dist[ \t]*=[ \t]*' "$RUNNER_ETC_DIR/emqx.conf" 2> /dev/null | tail -1 | awk -F"= " '{print $NF}') if [ -z "$PROTO_DIST" ]; then PROTO_DIST_ARG="" else diff --git a/bin/emqx_ctl b/bin/emqx_ctl index 33a8473ae..73f2fc960 100755 --- a/bin/emqx_ctl +++ b/bin/emqx_ctl @@ -65,7 +65,7 @@ if [ -z "$COOKIE" ]; then fi # Support for IPv6 Dist. See: https://github.com/emqtt/emqttd/issues/1460 -PROTO_DIST=$(grep -E '^[ \t]*cluster.proto_dist[ \t]*=[ \t]*' "$RUNNER_ETC_DIR"/emqx.conf 2> /dev/null | tail -1 | cut -d = -f 2-) +PROTO_DIST=$(grep -E '^[ \t]*cluster.proto_dist[ \t]*=[ \t]*' "$RUNNER_ETC_DIR"/emqx.conf 2> /dev/null | tail -1 | awk -F"= " '{print $NF}') if [ -z "$PROTO_DIST" ]; then PROTO_DIST_ARG="" else