how to return output from telnet connection to belkin router
Hi. Can anyone tell me how to access the output from a remote telnet command on the local machine?
I want to run a script on local machine which telnets to a belkin router, executes a command and return the output of that command to the script/local machine for further action. I can do it all except return the text for further processing. Any ideas? So far I have, with sundry sleeps to allow router to catch up:
(
echo open 192.168.1.1
echo "admin"
echo "ip ping <ipaddress>"
echo "user logout"
) | telnet
I need to know if the ping has been successful and then proceed if not.
TIA
--
Richard
|