|
|
@@ -1,4 +1,4 @@
|
|
|
-#!/bin/sh
|
|
|
+#!/bin/bash
|
|
|
# -*- tab-width:4;indent-tabs-mode:nil -*-
|
|
|
# ex: ts=4 sw=4 et
|
|
|
|
|
|
@@ -34,9 +34,6 @@ relx_nodetool() {
|
|
|
|
|
|
if [ -z "$NAME_ARG" ]; then
|
|
|
NODENAME="${EMQX_NODE_NAME:-}"
|
|
|
- # check if there is a node running, inspect its name
|
|
|
- # 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=$(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."
|
|
|
@@ -55,9 +52,6 @@ NAME="$(echo "$NAME_ARG" | awk '{print $2}')"
|
|
|
# Extract the target cookie
|
|
|
if [ -z "$COOKIE_ARG" ]; then
|
|
|
COOKIE="${EMQX_NODE_COOKIE:-}"
|
|
|
- # check if there is a node running, steal its cookie
|
|
|
- # 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=$(grep -E '^[ \t]*node.cookie[ \t]*=[ \t]*' "$RUNNER_ETC_DIR/emqx.conf" 2> /dev/null | tail -1 | cut -d = -f 2-)
|
|
|
if [ -z "$COOKIE" ]; then
|
|
|
echoerr "vm.args needs to have a -setcookie parameter."
|