diff options
Diffstat (limited to 'bin/blogin.in')
-rw-r--r-- | bin/blogin.in | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/bin/blogin.in b/bin/blogin.in index cae1bce..811a0d0 100644 --- a/bin/blogin.in +++ b/bin/blogin.in @@ -359,6 +359,10 @@ proc login { router user userpswd passwd enapasswd prompt cmethod cyphertype } { send "no\r" send_user "\nError: The host key for $router has changed. Update the SSH known_hosts file accordingly.\n" return 1 } + -re "Offending key for .* \(yes\/no\)\?" { + send "no\r" + send_user "\nError: host key mismatch for $router. Update the SSH known_hosts file accordingly.\n" + return 1 } -re "$u_prompt" { send "$user\r" expect { eof { send_user "\nError: Couldn't login\n"; wait; return 1 } @@ -383,13 +387,7 @@ proc login { router user userpswd passwd enapasswd prompt cmethod cyphertype } { } "$prompt" { break; } denied { send_user "\nError: Check your passwd for $router\n" - if { $do_command || $do_script } { - send "logout\r" - wait - return 1 - } else { - return 1 - } + catch {close}; wait; return 1 } "% Bad passwords" {send_user "\nError: Check your passwd for $router\n"; return 1 } } |