This question already has an answer here:
This Question is the continuation of My old question "TCL/Expect:: How to automate the router booting scenario?". Since I am not getting any response for that I am creating a new question.
My requirement : I want to automate router boot prompt scenario. That involves following steps:
- Login into a router
- Give reload
- Press Esp kep from keyboard continuously (You will get boot prompt by this)
Is there any way to automate this inbetween process (reload... to ... boot prompt)
I tried to use "plink.exe" as suggested by donal in my previous question. But when router reloads plink is also coming out.
Please suggest me any tool to automate this.
You can use
send
andexpect
to do this with code given below.After giving reload command, to get to the router's boot prompt, you are pressing the Esc Key and I believe you will prefer to wait for some random text which will appear on the reboot logs of router.
That text has to be added in the code segment
Make sure, you are replacing the "your ideal string here" with your preferable text.
You can refer the following links for the ASCII characters of printable and non-printable characters.
ASCII Table
ASCII Non-Printable