From 1a7c45398738cdb4eaafdc9e0962272f19d54816 Mon Sep 17 00:00:00 2001 From: Tar Committer Date: Tue, 5 Dec 2006 16:52:12 +0000 Subject: Imported from rancid-2.3.2a6.tar.gz. --- bin/clogin.in | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'bin/clogin.in') diff --git a/bin/clogin.in b/bin/clogin.in index 5406df3..81c654e 100644 --- a/bin/clogin.in +++ b/bin/clogin.in @@ -1,7 +1,8 @@ #! @EXPECT_PATH@ -- ## -## $Id: clogin.in,v 1.99 2006/08/10 07:00:30 heas Exp $ +## $Id: clogin.in,v 1.103 2006/12/05 16:50:52 heas Exp $ ## +## @PACKAGE@ @VERSION@ ## Copyright (C) 1997-2006 by Terrapin Communications, Inc. ## All rights reserved. ## @@ -75,6 +76,9 @@ if {[ info exists env(CISCO_USER) ]} { } regexp {\(([^)]*)} "$reason" junk default_user } +if {[ info exists env(CLOGINRC) ]} { + set password_file $env(CLOGINRC) +} # Sometimes routers take awhile to answer (the default is 10 sec) set timeout 45 @@ -100,13 +104,16 @@ for {set i 0} {$i < $argc} {incr i} { } set do_passwd 0 # VTY Password - } -v* - - -v* { + } -v* { if {! [ regexp .\[vV\](.+) $arg ignore passwd]} { incr i set passwd [ lindex $argv $i ] } set do_passwd 0 + # Version string + } -V* { + send_user "@PACKAGE@ @VERSION@\n" + exit 0 # Enable Username } -w* - -W* { @@ -489,14 +496,17 @@ proc login { router user userpswd passwd enapasswd cmethod cyphertype } { # Catalyst 1900s have some lame menu. Enter # K to reach a command-line. send "K\r" - exp_continue; + exp_continue + } + -re "Last login:" { + exp_continue } -re "@\[^\r\n]+ $p_prompt" { - # ssh pwd prompt - sleep 1 - send "$userpswd\r" - exp_continue - } + # ssh pwd prompt + sleep 1 + send "$userpswd\r" + exp_continue + } -re "$u_prompt" { send "$user\r" set uprompt_seen 1 @@ -677,6 +687,10 @@ proc run_commands { prompt command } { send "n\r" exp_continue } + "Configuration changes have occurred.*" { # Cisco CSS + send "n\r" + exp_continue + } "Do you wish to save your configuration changes" { send "n\r" exp_continue -- cgit