while [ 1 ]
do
status=$(route -n | grep UG | awk '{print $2}')
#echo "ip=$status"
if [ "$status" = "" ]; then
#echo "Default router not found .."
touch /tmp/wifi_error
else
test=$(ping $status -c 1 -W 7 | grep 100% )
#echo "$test"
if [ "$test" != "" ]; then
#echo "ping error"
touch /tmp/wifi_error
#else
#echo "ok"
fi

fi
sleep 1

done

 

arrow
arrow
    全站熱搜

    lynn770707 發表在 痞客邦 留言(0) 人氣()