标签:nc
nc命令检查端口是否存活
#!/bin/bash
for IP in `cat /log/ip_ubt.txt`
do
IPP="$IP 22"
/bin/nc -v -w 5 -z $IPP > /dev/null 2>&1
if [ $? -eq 0 ];then
echo $IPP:ok >> /log/ssh_22_ok.txt
echo $IP >> /log/ssh_22.txt
fi
done
本文出自 “linux” 博客,请务必保留此出处http://yangzhiming.blog.51cto.com/4849999/1900836
标签:nc
原文地址:http://yangzhiming.blog.51cto.com/4849999/1900836