Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Hello, I'm trying to test a tcp connection using telnet, I can't use expect or perl. I'm running telnet in the background (seeing how it's input oriented) then chekcing netstat for an established connection, and if found killing the telnet process, then displaying results. Any help would be greatly appreciated. Note, if you're going to use my script for testing please change the x.x.x.x with a valid ip address and possibly 1500 with a valid port. Also, these commands work just fine when running from the command line, however I always get a connection unseccessful when running in a script.
In your script, telnet goes to background and you check output nearly immediately, before anything useful has time to occur via network. Try putting sleep 1.
I've tried sleeping for up to 10 seconds with no change in status. Also, more often then not, the script won't report a successful connection. Though sometimes it does, leaving me to believe it's a timing issue as well...but having it sleep doesn't change anything. And, when running directly from the command line I get established from netstat immediately.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.