diff options
author | Tar Committer <tar@ocjtech.us> | 2002-01-04 21:31:49 +0000 |
---|---|---|
committer | Tar Committer <tar@ocjtech.us> | 2002-01-04 21:31:49 +0000 |
commit | 9f2402b0d86333f5f7e9d50437036cd3124bde47 (patch) | |
tree | 163861dc0a0052447f838d3674a35870a80026f5 /bin/blogin.in | |
parent | b0d71377c1854271b4511488422427f73d9473d1 (diff) | |
download | rancid-9f2402b0d86333f5f7e9d50437036cd3124bde47.tar.gz rancid-9f2402b0d86333f5f7e9d50437036cd3124bde47.tar.xz rancid-9f2402b0d86333f5f7e9d50437036cd3124bde47.zip |
Imported from rancid-2.2.tar.gz.rancid-2.2
Diffstat (limited to 'bin/blogin.in')
-rw-r--r--[-rwxr-xr-x] | bin/blogin.in | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/bin/blogin.in b/bin/blogin.in index ceb58e6..cae1bce 100755..100644 --- a/bin/blogin.in +++ b/bin/blogin.in @@ -278,8 +278,14 @@ proc login { router user userpswd passwd enapasswd prompt cmethod cyphertype } { # try each of the connection methods in $cmethod until one is successful set progs [llength $cmethod] foreach prog [lrange $cmethod 0 end] { - if ![string compare $prog "telnet"] { - if [ catch {spawn telnet $router} reason ] { + if [string match "telnet*" $prog] { + regexp {telnet(:([^[:space:]]+))*} $prog command suffix port + if {"$port" == ""} { + set retval [ catch {spawn telnet $router} reason ] + } else { + set retval [ catch {spawn telnet $router $port} reason ] + } + if { $retval } { send_user "\nError: telnet failed: $reason\n" exit 1 } @@ -351,7 +357,7 @@ proc login { router user userpswd passwd enapasswd prompt cmethod cyphertype } { exp_continue } -re "HOST IDENTIFICATION HAS CHANGED.* \(yes\/no\)\?" { send "no\r" - send_user "\nError: The host key for $router has changed. update the known_hosts file accordingly.\n" + send_user "\nError: The host key for $router has changed. Update the SSH known_hosts file accordingly.\n" return 1 } -re "$u_prompt" { send "$user\r" expect { @@ -549,7 +555,7 @@ foreach router [lrange $argv $i end] { # Figure out connection method set cmethod [find method $router] - if { "$cmethod" == "" } { set cmethod {{telnet} {ssh}} } + if { "$cmethod" == "" } { set cmethod {{telnet}} } # Login to the router if {[login $router $ruser $userpswd $passwd $enapasswd $prompt $cmethod $cyphertype]} { |