Automating CLI interactions with expect
I decided today to automate my interaction with my home router, a DSL-2750U, I usually use the web interface, but found out that a telnet management session is possible, of course, only accessible from the LAN, after some google search, I discovered this great program named expect, that automate interaction with any other CLI based programs.
This simple script “expect” a value from the router, then push information, in our case the credentials and the command to execute. Now, I can simply parse the hosts with grep, and have a better overview of my network.
tags: