列出指定IP段主机活动状态
cat ping.sh
#! /bin/bash # ping.sh for ip in 192.168.1.{1..255} do ping $ip -c 2 &> /dev/null if [ $? -eq 0 ] then echo $ip is alive. else echo $ip is not alive. fi done
转载于:https://blog.51cto.com/jiumiao/1255658
列出指定IP段主机活动状态
cat ping.sh
#! /bin/bash # ping.sh for ip in 192.168.1.{1..255} do ping $ip -c 2 &> /dev/null if [ $? -eq 0 ] then echo $ip is alive. else echo $ip is not alive. fi done
转载于:https://blog.51cto.com/jiumiao/1255658