[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: "internet connection tester script"



On 2010-03-27 07:07, Jozsef Vadkan wrote:
Why doesn't my "internet-connection" script work?

When I plug the ethcable out, it just waits...and waits...and waits...

The script: http://pastebin.com/AE9U1qdL


What happens when you pull the cable and then manually run:

    ping -W 1 -c 4 bix.hu
    echo $?

    ping -W 1 -c 4 bix.hu | grep -q "4 received"
    echo $?

    ping -W 1 -c 4 www.yahoo.com | grep -q "4 received"
    echo $?

Also, I'd add "-q" to the ping, and think about just checking it's $? instead of grepping for "4 received".

--
"History does not long entrust the care of freedom to the weak
or the timid."  Dwight Eisenhower


Reply to: