diff options
Diffstat (limited to 'bin/elogin.in')
-rw-r--r-- | bin/elogin.in | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/bin/elogin.in b/bin/elogin.in index 0084a1d..e13f206 100644 --- a/bin/elogin.in +++ b/bin/elogin.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 @@ -377,16 +377,16 @@ proc login { router user userpswd passwd prompt cmethod cyphertype } { send_user "\nError: Unknown host\n"; wait; 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 } @@ -414,21 +414,10 @@ 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." { exp_continue } - -re "^\[^\n\r *]*$reprompt" {} - -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." { exp_continue } -re "^\[^\n\r *]*$reprompt" {} |