#!/bin/bash
#Author:Willem
i=1
while [ $i -le 254 ]
do
ping -c 2 -i 0.3 -W 1 192.168.1.$i &>/dev/null
if [ $? -eq 0 ];then
echo "192.168.1.$i is up"
else
echo "192.168.1.$i is down"
fi
let i++
done
网友评论