7 replies
by radiic
Most unix sh commands return with an error level. Usually most return with 0= success of the command. Maybe you could check and see if telnet returns with errorlevel=0 after about the amount of time that it normally takes to complete a good connect, then you could kill the telnet session if it takes more than x seconds .
Just an Idea.
Rad
by woodwd234
by stillatit
Can you use rsh (remsh or rcmd on some systems) instead? This runs ONE command, and returns the result.
Another alternative might be to create a simple batch file which puts the current machine name and OS level into a text file and mails you thetext file. Install this on every machine, set to run out of crontabs however often you need it.
Good luck.
by woodwd234
by mdeshon
I'm assuming your program runs on a unix machine. If so, you can send a control-D character to hang up the connection immediately. Try the following line in your program:
echo '^D' | /usr/bin/telnet myhost
you can generate the control-D invi using the control-V command key (i.e. enter 'ctrl-V ctrl-D' to insert a ctrl-D)
Hope this helps,
matt
by woodwd234
by woodwd234
This discussion is closed to new replies.
Trending Linux posts
Sort by Trending