1. 程式人生 > >ping測試某網段網絡連通性

ping測試某網段網絡連通性

ash done line then -c seq off 8.14 don

ping測試某網段網絡連通性

#!/bin/bash
for i in `seq 1 14`;do
     ping 100.88.14.$i -c 2  >/dev/null
if  [ $? -eq 0 ];then
     echo "100.88.14.$i online"
else
     echo "100.88.14.$i offline"
fi
done   
#!/bin/bash
for i in {1..8};do
     ping 100.88.14.$i -c 2  >/dev/null
if  [ $? -eq 0 ];then
    echo "100.88.14.$i online"
else
    echo "100.88.14.$i offline"
fi
done   

ping測試某網段網絡連通性