SSH: Don't set "ServerAliveInterval" option explicitely
authorAlexander Barton <alex@barton.de>
Mon, 7 Dec 2015 09:13:15 +0000 (10:13 +0100)
committerAlexander Barton <alex@barton.de>
Mon, 7 Dec 2015 09:13:15 +0000 (10:13 +0100)
scripts/trigger-rcmd

index 17fd8a3..0ec4bec 100755 (executable)
@@ -73,7 +73,7 @@ do_rcmd() {
 
        for i in `seq 1 $SSH_CHECKS`; do
                echo "$NAME: checking SSH connection ($i/$SSH_CHECKS) ..."
-               ssh -q -o "ServerAliveInterval 120" "$SYSTEM" true >/dev/null 2>&1 && break
+               ssh -q "$SYSTEM" true >/dev/null 2>&1 && break
                echo "$NAME: SSH on \"$SYSTEM\" not ready. Waiting ..."
                sleep 10s
        done
@@ -87,7 +87,7 @@ do_rcmd() {
        echo "$NAME: calling \"$CMD\" on \"$SYSTEM\" ..."
        echo
 
-       ssh -q  -o "ServerAliveInterval 120" "$SYSTEM" "$CMD" </dev/null ; r=$?
+       ssh -q "$SYSTEM" "$CMD" </dev/null ; r=$?
 
        echo
        echo "$NAME: remote command ended with return code $r."
@@ -97,7 +97,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  -o "ServerAliveInterval 120" "$SYSTEM" "sync; shutdown -hP $SHUTDOWN_TIME" >/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