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/nlogin.in | |
parent | 1cc9f22072de1d314a67387aac57740fb25c5258 (diff) | |
download | rancid-2.3.2a5.tar.gz rancid-2.3.2a5.tar.xz rancid-2.3.2a5.zip |
Imported from rancid-2.3.2a5.tar.gz.rancid-2.3.2a5
Diffstat (limited to 'bin/nlogin.in')
-rw-r--r-- | bin/nlogin.in | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/bin/nlogin.in b/bin/nlogin.in index b5058bc..4b04a15 100644 --- a/bin/nlogin.in +++ b/bin/nlogin.in @@ -1,8 +1,8 @@ #! @EXPECT_PATH@ -- ## -## $Id: nlogin.in,v 1.27 2006/01/26 22:14:28 heas Exp $ +## $Id: nlogin.in,v 1.30 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 @@ -393,38 +393,38 @@ proc run_commands { prompt command } { for {set i 0} {$i < $num_commands} { incr i} { send "[subst [lindex $commands $i]]\r" expect { - -re "\[\n\r]+" { exp_continue } - -re "$prompt" {} - -gl "--- more ---" { - send " " - exp_continue - } + -re "\[\n\r]+" { exp_continue } + -re "$prompt" {} + -gl "--- more ---" { send " " + exp_continue + } } } } else { send "[subst $command]\r" expect { - -re "\[\n\r]+" { exp_continue } - -re "$prompt" {} - -gl "--- more ---" { - send " " - exp_continue - } + -re "\[\n\r]+" { exp_continue } + -re "$prompt" {} + -gl "--- more ---" { send " " + exp_continue + } } } send "exit\r" expect { - -re "$prompt" { - send "exit\r" - exp_continue - } - -re "\[\n\r]+" { exp_continue } - -gl "Configuration modified, save?" { - send "n\r" - exp_continue - } - timeout { return 0 } - eof { return 0 } + -re "$prompt" { + send "exit\r" + exp_continue + } + -re "\[\n\r]+" { exp_continue } + -gl "Configuration modified, save?" { + send "n\r" + exp_continue + } + timeout { catch {close}; wait + return 0 + } + eof { return 0 } } set in_proc 0 } |