I needed something similar myself, but I wanted to access telnet and find all ports. Then I wanted to remove specific port lines(their numbered, so i could use the numbers), then close the telnet afterwards. I will say I am more than capable to create this :)
This is going to be a executable file. I need your router-IP, username and password, or I can make a file where you can enter it yourself.