LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 01-18-2006, 08:53 PM   #1
michaelsanford
Member
 
Registered: Feb 2005
Location: Ottawa/Montréal
Distribution: Slackware + Darwin (MacOS X)
Posts: 468

Rep: Reputation: 30
Piping to telnet 80 failing


We're using a dynamic dns providor's script (referring to the CGI) to update our IP address (by their instructions) like so:

Code:
telnet host.com 80
GET /ip.cgi?host=our.host.com&key=g1c48672b5ba99d49d0a684aaac58b56
OK Host updated
However, when I do this from the shell, nothing works:
Code:
export DOMAIN_COMMAND="GET /ip.cgi?host=our.host.com&key=g1c48672b5ba99d49d0a684aaac58b56"
( sleep 1 ; echo $DOMAIN_COMMAND ; echo exit ) | telnet host.com 80
Trying host.com
Connected to host.com
Escape character is '^]'.
where it breaks
Connection closed by foreign host.
I get immediately dropped (well, after the sleep 1). Any ideas why entering the command long-hand works but passing it via a pipe doesn't ? Even a simple "echo 'GET /'" doesn't work.
 
Old 01-19-2006, 04:09 PM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Using a pipe in this context is simply sending bunk input to telnet. You need to use 'nc' (AKA netcat).
Code:
( sleep 1 ; echo $DOMAIN_COMMAND ; echo exit ) | nc host.com 80
 
Old 01-19-2006, 04:20 PM   #3
michaelsanford
Member
 
Registered: Feb 2005
Location: Ottawa/Montréal
Distribution: Slackware + Darwin (MacOS X)
Posts: 468

Original Poster
Rep: Reputation: 30
Thanks, I never thought of that !

I read a reply to someone asking how to log in automatically over telnet, and he used this method (i.e., my bad method) to enter username, password, etc. I guess it didn't work.
 
  


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
eth1 failing on boot, IEEE firewire card driver failing, help jackuss_169 Linux - Laptop and Netbook 5 03-05-2005 07:34 AM
LILO install failing, Boot failing, but Installation fine. sramelyk Slackware 9 08-23-2003 02:37 PM
Failing to connect to TELNET, FTP or SSH dbadft Linux - Networking 10 04-16-2003 02:44 PM
Telnet user redirectng/piping stdin/out? MikHud Linux - General 2 02-11-2002 04:18 AM
Telnet user redirectng/piping stdin/out? MikHud Linux - Networking 0 01-30-2002 10:55 AM

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

All times are GMT -5. The time now is 04:07 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration