展望未来 - 批量
type: channel
link: https://www.dnmr.net/tag/%E6%89%B9%E9%87%8F/
items: linux 批量ping 网断ip地址

linux 批量ping 网断ip地址
type: item
date: 2020-12-17T10:35:56+08:00
description: vim 新建 ping.sh. /etc/init.d/functions for var in {1..254}; do ip=121.18.132.$var ping -c2 $ip >/dev/null 2>&1 if [ $? = 0 ];then action "$ip" /bin/true else action "$ip" /bin/false fi done chmod 755 ping.shsh ping.sh