diff options
author | Tar Committer <tar@ocjtech.us> | 2006-05-04 21:40:56 +0000 |
---|---|---|
committer | Tar Committer <tar@ocjtech.us> | 2006-05-04 21:40:56 +0000 |
commit | 1cc9f22072de1d314a67387aac57740fb25c5258 (patch) | |
tree | f59aa9d622175580add0923bfac8963dc946e98e /bin/hlogin.in | |
parent | c0482931956d127b5f09d4a8d72758cd4cb1f097 (diff) | |
download | rancid-1cc9f22072de1d314a67387aac57740fb25c5258.tar.gz rancid-1cc9f22072de1d314a67387aac57740fb25c5258.tar.xz rancid-1cc9f22072de1d314a67387aac57740fb25c5258.zip |
Imported from rancid-2.3.2a4.tar.gz.rancid-2.3.2a4
Diffstat (limited to 'bin/hlogin.in')
-rw-r--r-- | bin/hlogin.in | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/bin/hlogin.in b/bin/hlogin.in index ab02f4f..f50891a 100644 --- a/bin/hlogin.in +++ b/bin/hlogin.in @@ -1,6 +1,6 @@ #! @EXPECT_PATH@ -- ## -## $Id: hlogin.in,v 1.28 2005/06/13 03:11:45 heas Exp $ +## $Id: hlogin.in,v 1.31 2006/02/07 19:06:55 heas Exp $ ## ## Copyright (C) 1997-2004 by Terrapin Communications, Inc. ## All rights reserved. @@ -369,11 +369,6 @@ proc login { router user userpswd passwd enapasswd cmethod cyphertype } { send_user "\nError: Connection Refused ($prog)\n"; return 1 } } - eof { send_user "\nError: Couldn't login\n"; wait; return 1 } - -nocase "unknown host\r" { - catch {close}; - send_user "\nError: Unknown host\n"; wait; return 1 - } "Host is unreachable" { catch {close}; send_user "\nError: Host Unreachable!\n"; wait; return 1 @@ -394,12 +389,21 @@ proc login { router user userpswd passwd enapasswd cmethod cyphertype } { send "no\r" send_user "\nError: host key mismatch for $router. Update the SSH known_hosts file accordingly.\n" return 1 } + eof { send_user "\nError: Couldn't login\n"; wait; return 1 } + -nocase "unknown host\r" { + catch {close}; + send_user "\nError: Unknown host\n"; wait; return 1 + } -re "$u_prompt" { send "$user\r" expect { eof { send_user "\nError: Couldn't login\n"; wait; return 1 } "Login invalid" { send_user "\nError: Invalid login\n"; vatch {close}; wait; return 1 } -re "$p_prompt" { send "$userpswd\r" } "$prompt" { set in_proc 0; return 0 } + "Press any key to continue" { + send " " + exp_continue + } } exp_continue } @@ -410,9 +414,18 @@ proc login { router user userpswd passwd enapasswd cmethod cyphertype } { send "$passwd\r" } expect { - eof { send_user "\nError: Couldn't login\n"; wait; return 1 } + eof { send_user "\nError: Couldn't login\n"; + wait; + return 1 + } + "Press any key to continue" { + send " "; + exp_continue + } -re "$e_prompt" { send "$enapasswd\r" } - "$prompt" { set in_proc 0; return 0 } + "$prompt" { set in_proc 0; + return 0 + } } exp_continue } |