]> arthur.barton.de Git - trigger-rcmd.git/commitdiff
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 c8f92ba68fc987a456a0f2bb9892d251222cade9..7d90e3bcc4bb750e2863e785bb51dc794bd53d5a 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