diff options
author | Tar Committer <tar@ocjtech.us> | 2006-08-12 02:59:43 +0000 |
---|---|---|
committer | Tar Committer <tar@ocjtech.us> | 2006-08-12 02:59:43 +0000 |
commit | a0be206eb419f63eeb436631cc91b3456dff006f (patch) | |
tree | c6881dc33ba7c94bb44193930402067bbe4350f5 /bin/htlogin.in | |
parent | 1cc9f22072de1d314a67387aac57740fb25c5258 (diff) | |
download | rancid-a0be206eb419f63eeb436631cc91b3456dff006f.tar.gz rancid-a0be206eb419f63eeb436631cc91b3456dff006f.tar.xz rancid-a0be206eb419f63eeb436631cc91b3456dff006f.zip |
Imported from rancid-2.3.2a5.tar.gz.rancid-2.3.2a5
Diffstat (limited to 'bin/htlogin.in')
-rw-r--r-- | bin/htlogin.in | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/bin/htlogin.in b/bin/htlogin.in index c95733b..03c3762 100644 --- a/bin/htlogin.in +++ b/bin/htlogin.in @@ -1,8 +1,8 @@ #! @EXPECT_PATH@ -- ## -## $Id: htlogin.in,v 1.13 2005/06/14 20:20:43 heas Exp $ +## $Id: htlogin.in,v 1.16 2006/08/10 07:00:31 heas Exp $ ## -## Copyright (C) 1997-2004 by Terrapin Communications, Inc. +## Copyright (C) 1997-2006 by Terrapin Communications, Inc. ## All rights reserved. ## ## This software may be freely copied, modified and redistributed @@ -389,7 +389,7 @@ proc run_commands { prompt command } { 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 *]*$prompt" {} -re "\[\n\r]" { exp_continue } } @@ -397,16 +397,18 @@ proc run_commands { prompt command } { } else { send "$command\r" expect { - -re "^\[^\n\r]*$prompt" {} + -re "^\[^\n\r]*$prompt" {} -re "^\[^\n\r *]*$prompt" {} -re "\[\n\r]" { exp_continue } } } send "exit\r" expect { - "\n" { exp_continue } - timeout { return 0 } - eof { return 0 } + "\n" { exp_continue } + timeout { catch {close}; wait + return 0 + } + eof { return 0 } } set in_proc 0 } |