方法一:
# cat check_port.sh #!/bin/bash cat ip.txt|while read line do /usr/bin/nc -w 1 -z $line > /dev/null 2>&1 if [ $? -eq 0 ] then echo telnet $line ok sleep 1 else echo telnet $line fail fi done # cat ip.txt 124.234.83.15 80 124.234.83.10 80
原文地址:https://www.cnblogs.com/miclesvic/p/10281193.html
时间: 2024-10-11 16:11:10