#!/bin/bash
myping(){
ping -c1 -w1 $1 &>/dev/null
num=$?
if [ $num -eq 0 ]
then
echo "$1 is up."
else
echo "$1 is down."
fi
}
for i in {1..25}
do
myping 192.168.254.$i
done
微信扫一扫
#!/bin/bash
myping(){
ping -c1 -w1 $1 &>/dev/null
num=$?
if [ $num -eq 0 ]
then
echo "$1 is up."
else
echo "$1 is down."
fi
}
for i in {1..25}
do
myping 192.168.254.$i
done
相关推荐