in reply to Re^2: How to catch/avoid SSHConnectionAborted
in thread How to catch/avoid SSHConnectionAborted
That should avoid the connection error being delayed, though you may also need to run some dummy command after it to let the module detect the closed SSH pipe:ssh_option => 'o NumberOfPasswordPrompts=1'
my $ssh; foreach (1..3) { $ssh = eval { my $try = Net::SSH::Expect->new( host => $host, password => $password, user => $user, raw_pty => 1, timeout => 3, binary => $ssh_exec, ssh_option => 'o NumberOfPasswordPrompts=1' ); $try->exec("stty raw -echo"); $try; }; last if $ssh; sleep 1; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: How to catch/avoid SSHConnectionAborted
by daphnaw (Acolyte) on Nov 16, 2010 at 10:25 UTC |