about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/ssh.pm11
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/ssh.pm b/scripts/ssh.pm
index c6d667a65d90..44a0e6f31b1c 100644
--- a/scripts/ssh.pm
+++ b/scripts/ssh.pm
@@ -25,13 +25,16 @@ sub openSSHConnection {
     # print "started" when it has established the connection, and wait
     # until we see that.
     open SSH, "ssh $sshHost @sshOpts -M -N -o LocalCommand='echo started' -o PermitLocalCommand=yes |" or die;
+
     while (<SSH>) {
         chomp;
-        last if /started/;
+        if ($_ eq "started") {
+            $sshStarted = 1;
+            return 1;
+        }
     }
-    
-    $sshStarted = 1;
-    return 1;
+
+    return 0;
 }
 
 # Tell the master SSH client to exit.