in reply to Re^6: Problem with Net::SSH::Expect on unavailable hosts
in thread Problem with Net::SSH::Expect on unavailable hosts
Now that I've looked at Expect.pm a little more closely, I can see that I'm not using $ssh->login() correctly...but it does seem to work. So give it a shot and I'll look for a better way of doing the retry loop.#sometimes the connection isn't ready to login yet, so we try up to +max_retry_count times before giving up my $retry_count = 0; while(1){ $rc = eval{$ssh->login();}; last if defined $rc; last if $retry_count >= $max_retry_count; $retry_count++; sleep 1; }
|
|---|