°Ô½Ã¹° 42°Ç
   
[½ºÅ©¸³Æ®] ¸ÖƼ Æ÷Æ® Á¡°Ë ½ºÅ©¸³Æ®
±Û¾´ÀÌ : ÃÖÀå¼· ³¯Â¥ : 2014-08-12 (È­) 14:11 Á¶È¸ : 3202
#!/bin/bash

######################################
# Port check script
# 2014/04/30 wrriten by rhetor
#######################################

#######################################
# Logic Flow
# 1. Target Info from list
# 2. run for loop host list
# 3. run for loop port list
#######################################

#######################################
# variable definition
#######################################

WORK_DIR=`pwd`
PORT_LIST="80 8080 4040 25"
HOST_LIST="1.1.1.1 1.1.1.2 1.1.1.3 1.1.1.4 1.1.1.4"

#######################################
# function definition
#######################################

F_TELNET() {
        I_NULL=`echo "quit" | telnet ${IP} ${PORT} | grep "Escape character is"`
       if [ "$?" -ne 0 ]; then
       RESULT="${RESULT}${PORT} failed "
       else
       RESULT="${RESULT}${PORT} succeeded "
       fi
}

for HOST in ${HOST_LIST}
do
HOST1=`echo ${HOST} | awk 'BEGIN {FS="_"} END {print $2}'`
IP=$HOST  #192.168.0.33#
RESULT="${HOST1}"
for PORT in ${PORT_LIST}
do
F_TELNET
done
echo $HOST - ${RESULT} 
done
exit 0;


À̸§ Æнº¿öµå
ºñ¹Ð±Û (üũÇÏ¸é ±Û¾´À̸¸ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.)
¿ÞÂÊÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.
   

miwit.com sir.co.kr DNS Powered by DNSEver.com DNS Powered by DNSEver.com