${subnet}#!/bin/bash
subnet="192.168.100"
`rm -rf ${subnet}_Up.log`
`rm -rf ${subnet}_Down.log`
for i in $(seq 1 254)
do
ping -c 1 -w 1 ${subnet}.$i && result=0 || result=1
if [ "$result" -eq 0 ]; then
echo "${subnet}.$i is Up" >> ${subnet}_Up.log
else
echo "${subnet}.$i is Down" >> ${subnet}_Down.log
fi
done
全站熱搜
留言列表