fix(boot): allow quoted node name and cookie
This commit is contained in:
parent
3863b7f116
commit
f5f79af418
4
bin/emqx
4
bin/emqx
|
@ -255,7 +255,7 @@ if [ -z "$NAME_ARG" ]; then
|
||||||
# check if there is a node running, inspect its name
|
# check if there is a node running, inspect its name
|
||||||
# shellcheck disable=SC2009 # pgrep does not support Extended Regular Expressions
|
# shellcheck disable=SC2009 # pgrep does not support Extended Regular Expressions
|
||||||
[ -z "$NODENAME" ] && NODENAME=$(ps -ef | grep -E '\-progname\s.*emqx\s' | grep -o -E '\-name (\S*)' | awk '{print $2}')
|
[ -z "$NODENAME" ] && NODENAME=$(ps -ef | grep -E '\-progname\s.*emqx\s' | grep -o -E '\-name (\S*)' | awk '{print $2}')
|
||||||
[ -z "$NODENAME" ] && NODENAME=$(grep -E '^[ \t]*node.name[ \t]*=[ \t]*' "$RUNNER_ETC_DIR/emqx.conf" 2> /dev/null | tail -1 | cut -d = -f 2-)
|
[ -z "$NODENAME" ] && NODENAME=$(grep -E '^[ \t]*node.name[ \t]*=[ \t]*' "$RUNNER_ETC_DIR/emqx.conf" 2> /dev/null | tail -1 | cut -d = -f 2- | tr -d '"')
|
||||||
if [ -z "$NODENAME" ]; then
|
if [ -z "$NODENAME" ]; then
|
||||||
echoerr "vm.args needs to have a -name parameter."
|
echoerr "vm.args needs to have a -name parameter."
|
||||||
echoerr " -sname is not supported."
|
echoerr " -sname is not supported."
|
||||||
|
@ -280,7 +280,7 @@ if [ -z "$COOKIE_ARG" ]; then
|
||||||
# check if there is a node running, steal its cookie
|
# check if there is a node running, steal its cookie
|
||||||
# shellcheck disable=SC2009 # pgrep does not support Extended Regular Expressions
|
# shellcheck disable=SC2009 # pgrep does not support Extended Regular Expressions
|
||||||
[ -z "$COOKIE" ] && COOKIE=$(ps -ef | grep -E '\-progname\s.*emqx\s' | grep -o -E '\-setcookie (\S*)' | awk '{print $2}')
|
[ -z "$COOKIE" ] && COOKIE=$(ps -ef | grep -E '\-progname\s.*emqx\s' | grep -o -E '\-setcookie (\S*)' | awk '{print $2}')
|
||||||
[ -z "$COOKIE" ] && COOKIE=$(grep -E '^[ \t]*node.cookie[ \t]*=[ \t]*' "$RUNNER_ETC_DIR/emqx.conf" 2> /dev/null | tail -1 | cut -d = -f 2-)
|
[ -z "$COOKIE" ] && COOKIE=$(grep -E '^[ \t]*node.cookie[ \t]*=[ \t]*' "$RUNNER_ETC_DIR/emqx.conf" 2> /dev/null | tail -1 | cut -d = -f 2- | tr -d '"')
|
||||||
if [ -z "$COOKIE" ]; then
|
if [ -z "$COOKIE" ]; then
|
||||||
echoerr "vm.args needs to have a -setcookie parameter."
|
echoerr "vm.args needs to have a -setcookie parameter."
|
||||||
echoerr "please check $RUNNER_ETC_DIR/emqx.conf"
|
echoerr "please check $RUNNER_ETC_DIR/emqx.conf"
|
||||||
|
|
|
@ -37,7 +37,7 @@ if [ -z "$NAME_ARG" ]; then
|
||||||
# check if there is a node running, inspect its name
|
# check if there is a node running, inspect its name
|
||||||
# shellcheck disable=SC2009 # pgrep does not support Extended Regular Expressions
|
# shellcheck disable=SC2009 # pgrep does not support Extended Regular Expressions
|
||||||
[ -z "$NODENAME" ] && NODENAME=$(ps -ef | grep -E '\progname\s.*emqx\s' | grep -o -E '\-name (\S*)' | awk '{print $2}')
|
[ -z "$NODENAME" ] && NODENAME=$(ps -ef | grep -E '\progname\s.*emqx\s' | grep -o -E '\-name (\S*)' | awk '{print $2}')
|
||||||
[ -z "$NODENAME" ] && NODENAME=$(grep -E '^[ \t]*node.name[ \t]*=[ \t]*' "$RUNNER_ETC_DIR/emqx.conf" 2> /dev/null | tail -1 | cut -d = -f 2-)
|
[ -z "$NODENAME" ] && NODENAME=$(grep -E '^[ \t]*node.name[ \t]*=[ \t]*' "$RUNNER_ETC_DIR/emqx.conf" 2> /dev/null | tail -1 | cut -d = -f 2- | tr -d '"')
|
||||||
if [ -z "$NODENAME" ]; then
|
if [ -z "$NODENAME" ]; then
|
||||||
echoerr "vm.args needs to have a -name parameter."
|
echoerr "vm.args needs to have a -name parameter."
|
||||||
echoerr " -sname is not supported."
|
echoerr " -sname is not supported."
|
||||||
|
@ -58,7 +58,7 @@ if [ -z "$COOKIE_ARG" ]; then
|
||||||
# check if there is a node running, steal its cookie
|
# check if there is a node running, steal its cookie
|
||||||
# shellcheck disable=SC2009 # pgrep does not support Extended Regular Expressions
|
# shellcheck disable=SC2009 # pgrep does not support Extended Regular Expressions
|
||||||
[ -z "$COOKIE" ] && COOKIE=$(ps -ef | grep -E '\-progname\s.*emqx\s' | grep -o -E '\-setcookie (\S*)' | awk '{print $2}')
|
[ -z "$COOKIE" ] && COOKIE=$(ps -ef | grep -E '\-progname\s.*emqx\s' | grep -o -E '\-setcookie (\S*)' | awk '{print $2}')
|
||||||
[ -z "$COOKIE" ] && COOKIE=$(grep -E '^[ \t]*node.cookie[ \t]*=[ \t]*' "$RUNNER_ETC_DIR/emqx.conf" 2> /dev/null | tail -1 | cut -d = -f 2-)
|
[ -z "$COOKIE" ] && COOKIE=$(grep -E '^[ \t]*node.cookie[ \t]*=[ \t]*' "$RUNNER_ETC_DIR/emqx.conf" 2> /dev/null | tail -1 | cut -d = -f 2- | tr -d '"')
|
||||||
if [ -z "$COOKIE" ]; then
|
if [ -z "$COOKIE" ]; then
|
||||||
echoerr "vm.args needs to have a -setcookie parameter."
|
echoerr "vm.args needs to have a -setcookie parameter."
|
||||||
echoerr "please check $RUNNER_ETC_DIR/emqx.conf"
|
echoerr "please check $RUNNER_ETC_DIR/emqx.conf"
|
||||||
|
|
Loading…
Reference in New Issue