From 8ef4954fc0372206f7d6ee8a3efbe07cb7de708f Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Sat, 27 Jan 2018 16:20:05 +0100 Subject: [PATCH] Redirect stderr when calling shutdown, too This is required to not trigger "error detection" of some mail wrapper scripts etc., that would notice output og shutdown(8) on stderr -- which outputs messages there, even when there is NO error ... --- scripts/trigger-rcmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/trigger-rcmd b/scripts/trigger-rcmd index 5d96d7f..55df738 100755 --- a/scripts/trigger-rcmd +++ b/scripts/trigger-rcmd @@ -102,7 +102,7 @@ do_rcmd() { if [ "$rsys_users" = "0" ]; then echo "$NAME: Power off \"$SYSTEM\" again ..." # shellcheck disable=2029 - ssh -o PreferredAuthentications=publickey -q "$SYSTEM" "sync; shutdown -hP $SHUTDOWN_TIME" >/dev/null + ssh -o PreferredAuthentications=publickey -q "$SYSTEM" "sync; shutdown -hP $SHUTDOWN_TIME" 2>&1 >/dev/null if [ $? -ne 0 ]; then echo "$NAME: Failed to power off \"$SYSTEM\"!" >&2 return 5 -- 2.39.2