Cisco IOS Script pause execute
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2013 12:42 PM - edited 03-07-2019 12:28 PM
I'm writting a script for my router to performe a series of functions. Basically cutting and pasting from notepad with a series of commands to execute. Does any one know how to make IOS pause for a set number of seconds before continuing. For example:
One of those commands is power inline never on a switch. I'd like the device to wait 15 seconds before moving to the next step which is power inline never. To give all the phones a chance to power down before they come back up. A better example is below.
I've tried every thing, but can't find how to do that.
power inline never
(wait 15 secs)
power inline auto
thanks,
- Labels:
-
Other Switching
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2013 01:24 PM
Your using tclsh to paste in the config and want it to pause for 15 seconds? If so, you can use the after command. The after command takes the value in ms.
SPOKE_1(tcl)#show clock
*16:21:30.543 EDT Mon Mar 25 2013
SPOKE_1(tcl)#after 15000
SPOKE_1(tcl)#show clock
*16:21:45.562 EDT Mon Mar 25 2013
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2013 02:02 PM
Thanks for the reply. I was doing it from notepad and pasting the commands as if I was typing them in. I've used tcl scripts before to configure an IVR in CME; but i'm not familiar with tclsh. It seems to be a better way. Can you send me some more information on that tool, or where can I find some more info on it?
thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2013 02:41 PM
tclsh (TCL shell) allows you to run TCL commands interactively. Also allows users to execute CLI commands into tclsh. Take a look at the link below.
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2017 12:08 PM
the link says:
Forbidden File or Application
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2017 12:06 PM
I know it's an old thread but it's still my question also. I'm looking for that same thing right now. I want to paste into a router the following.
ping 1.2.3.4
<delay, pause, sleep, whatever for 10 seconds>
ping 1.2.3.5
<delay, pause, sleep, whatever for 10 seconds>
ping 1.2.3.6
<delay, pause, sleep, whatever for 10 seconds>
If I simply paste a list of pings into the console, the router does approximately every third or fourth one, so if I could insert a 10 second pause it would most likely work.
I assume tclsh is an install or something? The link is dead. What's involved in tclsh. I just need this this one time. I don't want to install something.
Maybe I'm barking up the wrong tree. Maybe the problem is the terminal doesn't wait for output to finish before interpreting the next command ..... It seems to be inhaling the paste and applying a ping or two while the first ping is still processing, so it ignores them.
Maybe I need a new terminal protocol???? or turn on a feature of vty???
I'm in SecureCRT, SSH2, vt100.
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2017 12:22 PM
nothing to install. Execute this CLI putting in your IP addresses and it will wait 10 seconds between pinging each IP.
Router#tclsh
Router(tcl)#foreach IP {192.168.0.1 192.168.0.2 192.168.0.3} {
ping $IP
after 10000
}
Link works fine for me.
