Redirect stderr when calling shutdown, too master
authorAlexander Barton <alex@barton.de>
Sat, 27 Jan 2018 15:20:05 +0000 (16:20 +0100)
committerAlexander Barton <alex@barton.de>
Sat, 27 Jan 2018 15:20:07 +0000 (16:20 +0100)
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

index 5d96d7f..55df738 100755 (executable)
@@ -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