![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Open Ports on System | aldowsary | AIX | 2 | 11-25-2006 09:38 PM |
| Test Ports | By_Jam | UNIX for Dummies Questions & Answers | 3 | 10-31-2006 01:14 AM |
| determining open ports | matrixmadhan | UNIX for Advanced & Expert Users | 7 | 07-18-2005 12:17 AM |
| How To Open Ports in RedHat ? | Sirius | Linux | 7 | 09-06-2003 05:48 AM |
| closing open ports | LowOrderBit | Security | 10 | 09-27-2001 10:43 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Telnet script to test open ports on mult servers
Hello All,
Can somebody help me with this script. I have an output file with a list of servers ips and ports. I need to be able to run this script to list all the server ips in the outfile and find out if the port is open or not. #!/bin/sh IFS=#;for i in $(cat portTest); do # check for open ports # connTest=`echo " " | telnet $i` if [ "`echo $connTest | awk '{ print $3 }` " = "Connected" ] then echo "$connTest port is up" else echo "$connTest port is down" fi done The output i am getting now is this 148.xxx.xx.89 44441 148.xxx.xx.92 44441 148.xxx.xx.95 44441 148.xxx.xx.98 44441 148.xxx.xx.101 44441 148.xxx.xx.104 44441 148.xxx.xx.107 44441 port is down Can somebody pls tell me what i am doing wrong. I've searched the thread and couldn't find anything that is remotely similar. Please note i don't need to specify a username or password. Thanks for all your help AC |
| Forum Sponsor | ||
|
|