[cisco-voip] Non-interactive CLI commands?

David Sullivan David.Sullivan at barnet.ac.uk
Wed Nov 21 10:42:20 EST 2007


cisco-voip-bounces at puck.nether.net wrote:
> jean-francois.guay at bell.ca wrote:
>> Are you using FTP to copy of HTTP?
>> 
>> With FTP, you would need to start by configuring the ftp username and
>> password in the general config, then issue:
>> 
>> # copy ftp://source filename url> flash:<destination filename>
>> *enter* And at the end of your script send an extra "enter/line
>> feed" that will actually confirm your command to the router.
> 
> Well, I'm using HTTP so that I don't need to provide login
> credentials when I pull the IOS to the router.
> 
> The sticking point is that I want to make this script _very_ simple.
> Using clogin from RANCID I can script non-interactive
> commands quite easily, but to get the script to send extra CR
> is the issue, and I'd prefer not to do that.

Sending CR isn't tricky, just add \n to the end of the line and that'll
send a CR after your command. I've some upgrade scripts for older
switches where I have to use this for deleting old content since they
don't support recursive deletes and prompt.

But this there is a better way:

http://ioshints.blogspot.com/2006/11/reduce-noise-generated-by-cisco-ios
.html

Note the caveat though, you may not want it saved back to the
startup-config

David Sullivan
IT Services Systems Team
Barnet College
-----------------------------------------------------------------------------
This communication may contain privileged or confidential information which
is for the exclusive use of the intended recipient.  If you are not the
intended recipient, please note that you may not distribute or use this
communication or the information it contains.  If this e-mail has reached you
in error, please delete it and any attachment.

Internet communications are not secure and Barnet College does not accept
legal responsibility for the content of this message.  Any views or opinions
expressed are those of the author and not necessarily those of Barnet College.

Please note that Barnet college reserves the right to monitor the
source/destinations of all incoming or outgoing e-mail communications.
-----------------------------------------------------------------------------



More information about the cisco-voip mailing list