]> arthur.barton.de Git - trigger-rcmd.git/blobdiff - scripts/trigger-rcmd
Don't indicate error for "no wake" systems
[trigger-rcmd.git] / scripts / trigger-rcmd
index a2bf18f04dd5d06ab85db1d39df861d5d2f746c5..ec70d958f2864ae3c42912115fbbccb615d3bb4f 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 #
 # trigger-rcmp: Trigger remote commands
-# Copyright (c)2014-2016 Alexander Barton (alex@barton.de)
+# Copyright (c)2014-2017 Alexander Barton (alex@barton.de)
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -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