diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-08-24 14:27:07 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-08-24 14:27:07 +0000 |
commit | 1e5f5ea2e9f522397c05e710ae32ff7c0b0f1611 (patch) | |
tree | 576d3e2030ad23b05b4a78e0a477edb246621291 | |
parent | 034f608e004c3206ff99c55c107139c38bfe9408 (diff) |
* Correctly handle SSH failing to establish a connection. Because
this didn't work right, the build hook wouldn't fall back to using
other machines of the desired type.
-rw-r--r-- | scripts/ssh.pm | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/ssh.pm b/scripts/ssh.pm index c6d667a65..44a0e6f31 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. |