summaryrefslogtreecommitdiffstats
path: root/bin/rivlogin.in
diff options
context:
space:
mode:
authorTar Committer <tar@ocjtech.us>2005-03-30 07:52:00 +0000
committerTar Committer <tar@ocjtech.us>2005-03-30 07:52:00 +0000
commit4d684aecaacc9a59e7e9c0661934aeba0b16efec (patch)
tree84adf7c191abe898368aa09c6b3592f40250a42c /bin/rivlogin.in
parent654a4573f8fd2b1109e0ded8d9ce061dd3a2093f (diff)
downloadrancid-4d684aecaacc9a59e7e9c0661934aeba0b16efec.tar.gz
rancid-4d684aecaacc9a59e7e9c0661934aeba0b16efec.tar.xz
rancid-4d684aecaacc9a59e7e9c0661934aeba0b16efec.zip
Imported from rancid-2.3.2a.tar.gz.rancid-2.3.2a
Diffstat (limited to 'bin/rivlogin.in')
-rw-r--r--bin/rivlogin.in19
1 files changed, 16 insertions, 3 deletions
diff --git a/bin/rivlogin.in b/bin/rivlogin.in
index 4468fff..bbfa9b5 100644
--- a/bin/rivlogin.in
+++ b/bin/rivlogin.in
@@ -1,6 +1,6 @@
#! @EXPECT_PATH@ --
##
-## $Id: rivlogin.in,v 1.17 2004/02/02 17:38:36 heas Exp $
+## $Id: rivlogin.in,v 1.18 2004/07/19 00:06:08 afort Exp $
##
## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
@@ -380,12 +380,25 @@ proc do_enable { enauser enapasswd userpswd } {
if { $verbose == 1 } {
puts "DEBUG: do_enable: my_prompt = $my_prompt ena_prompt = $enable_prompt"
}
+
+ set uses_username 0;
send "enable\r"
expect {
- Username: { send "$enauser\r"; exp_continue }
- Password: { send "$userpswd\r"; exp_continue }
+ Username: {
+ set uses_username 1;
+ send "$enauser\r";
+ exp_continue
+ }
+ Password: {
+ if {$uses_username == 1} {
+ send "$userpswd\r";
+ } else {
+ send "$enapasswd\r";
+ }
+ exp_continue
+ }
"$my_prompt" {
puts "ERROR: do_enable failed to gain enable mode."