标签:done style $? int pre success nec sts echo
端口检测
1 #!/bin/bash 2 3 #list="10.68.133.104 10.68.133.105 10.68.133.106 10.68.133.107 10.68.133.108 10.68.133.109 10.68.133.110 10.68.133.111 10.68.133.112 10.68.133.113 10.68.133.114" 4 #list="10.31.126.37" 5 ports="22" 6 j="22" 7 #ports="6379 6378" 8 for i in `cat hosts_titan600` 9 do 10 # for j in $ports 11 # do 12 # echo $i $j is apoint 13 # ssh -v -p $j $i|grep "established" 14 nc $i $j </dev/null 2>/dev/null 15 if [ $? -eq 0 ];then 16 echo $i $j connect success 17 else 18 echo $i $j connect failure 19 fi 20 # done 21 done
标签:done style $? int pre success nec sts echo
原文地址:https://www.cnblogs.com/landerhu/p/12036418.html