fix: add the 'die' function in bin/emqx

This commit is contained in:
Zaiming (Stone) Shi 2022-08-11 08:25:37 +02:00
parent ccb51265b8
commit 6a0d2c9d46
1 changed files with 7 additions and 0 deletions

View File

@ -36,6 +36,13 @@ ERTS_LIB_DIR="$ERTS_DIR/../lib"
# Echo to stderr on errors
echoerr() { echo "$*" 1>&2; }
die() {
set +x
echoerr "ERROR: $1"
errno=${2:-1}
exit "$errno"
}
assert_node_alive() {
if ! relx_nodetool "ping" > /dev/null; then
die "node_is_not_running!" 1