LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-06-2014, 01:25 PM   #1
cs1jrw
LQ Newbie
 
Registered: Jun 2011
Posts: 5

Rep: Reputation: Disabled
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
 
Old 03-06-2014, 01:41 PM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
There are plenty of threads out there about using expect to pull down output. Do a quick search using your keywords "telnet router expect" and see what turns up.
 
Old 03-07-2014, 09:10 AM   #3
cs1jrw
LQ Newbie
 
Registered: Jun 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by szboardstretcher View Post
There are plenty of threads out there about using expect to pull down output. Do a quick search using your keywords "telnet router expect" and see what turns up.
Thanks, but should have mentioned that the querying box is running ttylinux for which neither tcl nor expect are available (I expect!)
--
Richard
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Poor wireless connection to my Belkin router ChunkyDrew Linux - Hardware 2 11-12-2012 06:15 PM
Running Telnet in a script, want to save Telnet output, howtodothis??? anil3 Linux - Software 2 03-08-2006 05:01 PM
unable to ssh & telnet using Belkin 54G router kvellimalai Linux - Networking 2 01-23-2006 07:06 AM
Belkin Wireless Card Connecting To Belkin Router Skippy06 SUSE / openSUSE 1 02-02-2005 03:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration