#!/bin/bash
#2012-7-16
cat /dev/null > alive.txt
cat /dev/null > downing.txt
for n in {1..254};do
host=192.168.1.$n
ping -c2 -w1 $host &> /dev/null
if [ $? = 0 ] ; then
echo "$host is UP"
echo "$host" >> alive.txt
else
echo "$host is downing."
echo "$host" >> downing.txt
fi
done
阅读(1391) | 评论(0) | 转发(1) |