diff options
author | unknown <unknown@unknown> | 2008-12-17 03:43:51 +0000 |
---|---|---|
committer | unknown <unknown@unknown> | 2008-12-17 03:43:51 +0000 |
commit | 09f0f026fd4931b90016d0090778983da01c294a (patch) | |
tree | d47c450de794595ce6395bde6ff084d75dac48a4 /bin/alogin.in | |
parent | b73f299e731fbddae095c0b5eff04717b6dce1af (diff) | |
download | rancid-09f0f026fd4931b90016d0090778983da01c294a.tar.gz rancid-09f0f026fd4931b90016d0090778983da01c294a.tar.xz rancid-09f0f026fd4931b90016d0090778983da01c294a.zip |
Imported from rancid-2.3.2a9.tar.gz.rancid-2.3.2a9
Diffstat (limited to 'bin/alogin.in')
-rw-r--r-- | bin/alogin.in | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/bin/alogin.in b/bin/alogin.in index c21b49f..a17bd2a 100644 --- a/bin/alogin.in +++ b/bin/alogin.in @@ -3,7 +3,7 @@ ## $Id$ ## ## @PACKAGE@ @VERSION@ -## Copyright (c) 1997-2007 by Terrapin Communications, Inc. +## Copyright (c) 1997-2008 by Terrapin Communications, Inc. ## All rights reserved. ## ## This code is derived from software contributed to and maintained by @@ -385,16 +385,16 @@ proc login { router user userpswd passwd prompt cmethod cyphertype } { return 1 } -re "$u_prompt" { - send "$user\r" + send -- "$user\r" set uprompt_seen 1 exp_continue } -re "$p_prompt" { sleep 1 if {$uprompt_seen == 1} { - send "$userpswd\r" + send -- "$userpswd\r" } else { - send "$passwd\r" + send -- "$passwd\r" } exp_continue } @@ -425,24 +425,14 @@ proc run_commands { prompt command } { regsub -all "\[)(]" $prompt {\\&} reprompt - # Is this a multi-command? - if [ string match "*\;*" "$command" ] { - set commands [split $command \;] - set num_commands [llength $commands] - for {set i 0} {$i < $num_commands} { incr i} { - send "[subst -nocommands [lindex $commands $i]]\r" - expect { - -re "^\[^\n\r]*$reprompt" {} - -re "^\[^\n\r ]*>>.*$reprompt" { exp_continue } - -re "\[\n\r]+" { exp_continue } - } - } - } else { - send "[subst -nocommands $command]\r" + set commands [split $command \;] + set num_commands [llength $commands] + for {set i 0} {$i < $num_commands} { incr i} { + send -- "[subst -nocommands [lindex $commands $i]]\r" expect { - -re "^\[^\n\r]*$reprompt" {} - -re "^\[^\n\r ]*>>.*$reprompt" { exp_continue } - -re "\[\n\r]+" { exp_continue } + -re "^\[^\n\r]*$reprompt" {} + -re "^\[^\n\r ]*>>.*$reprompt" { exp_continue } + -re "\[\n\r]+" { exp_continue } } } send "exit\r" |