diff options
Diffstat (limited to 'bin/htlogin.in')
-rw-r--r-- | bin/htlogin.in | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/bin/htlogin.in b/bin/htlogin.in index 2c04e6a..fbe8b1f 100644 --- a/bin/htlogin.in +++ b/bin/htlogin.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 @@ -379,16 +379,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 } @@ -411,25 +411,14 @@ proc run_commands { prompt command } { global in_proc set in_proc 1 - # 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 "[lindex $commands $i]\r" - expect { - -re "^\[^\n\r]*$prompt" {} - -re "^\[^\n\r *]*$prompt" {} - -re "\[\n\r]" { exp_continue } - } - } - } else { - send "$command\r" + set commands [split $command \;] + set num_commands [llength $commands] + for {set i 0} {$i < $num_commands} { incr i} { + send -- "[lindex $commands $i]\r" expect { - -re "^\[^\n\r]*$prompt" {} - -re "^\[^\n\r *]*$prompt" {} - -re "\[\n\r]" { exp_continue } + -re "^\[^\n\r]*$prompt" {} + -re "^\[^\n\r *]*$prompt" {} + -re "\[\n\r]" { exp_continue } } } send "exit\r" |