Don't indicate error for "no wake" systems
authorAlexander Barton <alex@barton.de>
Sun, 22 Oct 2017 16:57:47 +0000 (18:57 +0200)
committerAlexander Barton <alex@barton.de>
Sun, 22 Oct 2017 16:57:47 +0000 (18:57 +0200)
scripts/trigger-rcmd

index 57408c4..ec70d95 100755 (executable)
@@ -164,7 +164,12 @@ while [ $# -gt 0 ]; do
                fi
                NAME=$BASENAME
        fi
-       [ $r -ne 0 ] && result=1
+       if [ $r -ne 0 ]; then
+               # Exit code indicates an error. But only flag this as error
+               # when target should have been woken up and the indicated error
+               # is not "system down" (9).
+               [ -z "$NO_WAKE" ] || [ $r -ne 9 ] && result=1
+       fi
        shift
        [ $# -gt 0 ] && echo
 done