jamiecaesar / securecrt-tools

SecureCRT scripts, written in Python, for doing various tasks when connected to Cisco equipment.
Apache License 2.0
252 stars 77 forks source link

Use WaitForString() timeout in scripts #11

Closed jamiecaesar closed 8 years ago

jamiecaesar commented 9 years ago

There is a timeout value that can be passed into WaitForString(). It also has a return code that will indicate if the timeout was reached. Modify scripts to use this so if something hangs, or if the script isn't seeing the expected text that the script won't hang forever (or until manually cancelled).

methridge commented 9 years ago

I can see where this might be a good idea in the GetHostname() function as that's usually the first thing we do. And with this we could determine that we're not connected to a system and abort the script.

But doing this every time there's a WaitForString() may be a bit much.

There may also be some cases where we need to add the timeout in the main() before we call GetHostname().

jamiecaesar commented 8 years ago

Closing -- probably won't be changing anything on this.