#!/bin/bash
#user: xwyhhhh1
#Email: bianhao6636@163.com
TELNET_IP="192.168.0.193"
USAGE(){
echo "usage error,Please refer to the following usage"
echo "xxx.sh [ports]"
}
TELNET_PORT(){
if which telnet > /dev/null 2>&1 ;then
for i in $@
do
result=$(echo -e "\n" | telnet $TELNET_IP $i 2>/dev/null | grep Connected | wc -l)
if [ $result -ge 1 ] ;then
echo "$i connection !!"
else
echo "$i not connection"
fi
done
else
timeout 10s yum -y install telnet
fi
}
if [[ $TELNET_IP == "" ]] ;then
echo "TELNET_IP Is empty"
exit 1;
else
if [ $# -ge 1 ] ;then
TELNET_PORT "$@"
else
USAGE
fi
fi
telnet端口脚本
原创
©著作权归作者所有:来自51CTO博客作者全能动作X的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:LNMP搭建wordpress
下一篇:php
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章