新建一个ip-list.txt文件,录入ip地址
while read ip; do ping -c 1 -W 1 "$ip" >/dev/null && echo "$ip 通" || echo "$ip 不通" done < ip-list.txt