Make "shutdown time" configurable: SHUTDOWN_TIME
authorAlexander Barton <alex@barton.de>
Sat, 29 Nov 2014 15:30:53 +0000 (16:30 +0100)
committerAlexander Barton <alex@barton.de>
Sat, 29 Nov 2014 15:30:57 +0000 (16:30 +0100)
And change it to 10 minutes (was 1).

scripts/trigger-rcmd

index c8f92ba..7d90e3b 100755 (executable)
@@ -27,6 +27,7 @@ do_rcmd() {
        TIMEOUT="180"
        SSH_CHECKS="6"
        WAKE_DELAY="10s"
+       SHUTDOWN_TIME="+10"
 
        . "$cnf"
 
@@ -89,7 +90,7 @@ do_rcmd() {
                rsys_users=`ssh -q "$SYSTEM" w | tail -n +3 | wc -l`
                if [ "$rsys_users" = "0" ]; then
                        echo "$NAME: power off \"$SYSTEM\" again ..."
-                       ssh -q "$SYSTEM" "sync; shutdown -hP +1" >/dev/null
+                       ssh -q "$SYSTEM" "sync; shutdown -hP $SHUTDOWN_TIME" >/dev/null
                        if [ $? -ne 0 ]; then
                                echo "$NAME: failed to power off \"$SYSTEM\"!" >&2
                                return 5