[rancid] Re: Force a disconnect after running some commands?

john heasley heas at shrubbery.net
Mon Sep 4 20:25:27 UTC 2006


Mon, Sep 04, 2006 at 04:18:24PM -0400, psmith at metafore.ca:
> 
> Many thanks to John for his assistance so far..
> 
> My final issue is this.
> 
> My script runs a bunch of commands, and the final command is after doing a
> firmware update. The final command is "reset save-config yes no-prompt".
> The Netscreen then returns the line "In reset ..."
> 
> 
> Program flash (8534273 bytes) ...
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++done
> 
> Done
> harv5007->  reset save-config yes no-prompt
> In reset ...
> 
> However, Rancid appears to hang at this point, until I do  CTRL-C to break
> the script. Is there any way to have nlogin ends its run when it see the
> "In reset" part?

just "return".  the main loop of the login scripts sources the supplied
script.  when that script ends, it closes the pty and goes on to the next
router (if there is one).
	send load config
	expect {success {send reset ...} failure {}}
	# script EOF

you could also just call exit, but then you can't run multiple routers from
1 nlogin.

> I am trying to automate as much of this project I am working on, and I have
> the master shell script email the results from the firmware upgrade and
> config changes after nlogin works its magic.
> 
> However at this point, with nlogin hanging, the email is not sent until the
> CTRL-C is issued.
> 
> Any advice?
> 
> ---------------------------------------------------
> Paul W. Smith
> Senior Network Operations Engineer
> MCP, SCWSE, SCSA, SCNA, ACE, 3CSA, CNS, CLS, JNCIA-FWV, JNSS-S, JNSA-S
> Enterprise Services
> Metafore IT Solutions
> Direct: 905.362.7290
> Cell: 416.271.6937
> Toll Free: 800.563.7515 x 4086
> psmith at metafore.ca
> http://www.metafore.ca
> 
> M E T A F O R E
> IT SOLUTIONS
> ----------------------------------------------------
> 
> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss at shrubbery.net
> http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss



More information about the Rancid-discuss mailing list