From b4eb0c4df6fae0c4987617cafce8719b5b5d5e85 Mon Sep 17 00:00:00 2001 From: z8674558 Date: Thu, 3 Jun 2021 16:24:35 +0900 Subject: [PATCH] chore(bin/emqx): use hocon get --- bin/emqx | 4 ++-- rebar.config | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/emqx b/bin/emqx index 5f1b6d213..413501a04 100755 --- a/bin/emqx +++ b/bin/emqx @@ -293,7 +293,7 @@ if [ -z "$NAME_ARG" ]; then else # for boot commands, inspect emqx.conf for node name # todo: use get command from hocon escript - NODENAME=$(grep -E '^[ \t]*node.name[ \t]*=[ \t]*' "$RUNNER_ETC_DIR/emqx.conf" 2> /dev/null | tail -1 | awk -F"= " '{print $NF}'| tr -d \") + NODENAME="$("$ERTS_PATH"/escript "$RUNNER_ROOT_DIR"/bin/hocon -s emqx_schema -c "$RUNNER_ETC_DIR"/emqx.conf get node.name | tr -d \")" fi fi if [ -z "$NODENAME" ]; then @@ -319,7 +319,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 | awk -F"= " '{print $NF}'| tr -d \") + COOKIE="$("$ERTS_PATH"/escript "$RUNNER_ROOT_DIR"/bin/hocon -s emqx_schema -c "$RUNNER_ETC_DIR"/emqx.conf get node.cookie | tr -d \")" else # shellcheck disable=SC2012,SC2086 LATEST_VM_ARGS="$(ls -t $RUNNER_DATA_DIR/configs/vm.*.args | head -1)" diff --git a/rebar.config b/rebar.config index d70dc4f82..cf2a46aac 100644 --- a/rebar.config +++ b/rebar.config @@ -56,7 +56,7 @@ , {observer_cli, "1.6.1"} % NOTE: depends on recon 2.5.1 , {getopt, "1.0.1"} , {snabbkaffe, {git, "https://github.com/kafka4beam/snabbkaffe.git", {tag, "0.13.0"}}} - , {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.3.2"}}} + , {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.4.0"}}} ]}. {xref_ignores,