From 562ce1a81b9664eeada471f303ba5f83c9470409 Mon Sep 17 00:00:00 2001 From: Zaiming Shi Date: Wed, 4 Aug 2021 17:38:01 +0200 Subject: [PATCH] feat: bin/emqx pass down DEBUG if su exec --- bin/emqx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/emqx b/bin/emqx index 0afa81bc5..af2a7f433 100755 --- a/bin/emqx +++ b/bin/emqx @@ -5,7 +5,8 @@ set -e set -o pipefail -if [ -n "$DEBUG" ]; then +DEBUG="${DEBUG:-0}" +if [ "$DEBUG" -eq 1 ]; then set -x fi @@ -113,7 +114,7 @@ check_user() { echo "You need to be root or use sudo to run this command" exit 1 fi - CMD="\"$RUNNER_SCRIPT\" " + CMD="DEBUG=$DEBUG \"$RUNNER_SCRIPT\" " for ARG in "$@"; do CMD="${CMD} \"$ARG\"" done