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
Hi Jozsef,
On Sat, Mar 27, 2010 at 12:07 PM, Jozsef Vadkan jozsi.avadkan@gmail.com wrote:
Why doesn't my "internet-connection" script work?
I suggest you double-check the Advanced Bash Scripting Guide. You posted this to a couple of sites.
In your if statements, you must do if `statement`; then foo; fi Don't forget to put ` around the statement you have there (ping something | grep something).
On 27 March 2010 12:07, Jozsef Vadkan jozsi.avadkan@gmail.com 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
This is a ping script I use to check my boxes are all up an running each morning, change the IPs for a few hosts i.e. www.google.com, www.yahoo.com, www.youtube.com etc and hopefully that will help you.
Also try not to post the same question to two mailing lists at the same time, I am having to cross post so that if my reply helps you, it gets archived on both lists ;)
On 27 March 2010 12:47, James Bensley jwbensley@gmail.com wrote:
On 27 March 2010 12:07, Jozsef Vadkan jozsi.avadkan@gmail.com 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
This is a ping script I use to check my boxes are all up an running each morning, change the IPs for a few hosts i.e. www.google.com, www.yahoo.com, www.youtube.com etc and hopefully that will help you.
Also try not to post the same question to two mailing lists at the same time, I am having to cross post so that if my reply helps you, it gets archived on both lists ;)
Would help if I actually put the link in maybe? Doh!
http://pastebin.com/raw.php?i=QRYHjDpQ
Am 27.03.2010 13:48, schrieb James Bensley:
Would help if I actually put the link in maybe? Doh!
Why `ping -c $PCount $hosts | grep "64 bytes" | wc | awk {'print $1'}' when `ping -c $PCount $hosts | grep -c "64 bytes"' is sufficient?
Alexander
On 27 March 2010 12:56, Alexander Dalloz <ad+lists@uni-x.orgad%2Blists@uni-x.org
wrote:
Am 27.03.2010 13:48, schrieb James Bensley:
Would help if I actually put the link in maybe? Doh!
Why `ping -c $PCount $hosts | grep "64 bytes" | wc | awk {'print $1'}' when `ping -c $PCount $hosts | grep -c "64 bytes"' is sufficient?
Hah! Didn't think of the -c, a lapse on my part. Thanks for pointing that out ;)
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
DNS lookups take a long time to time out and fail. You could try a ping to your default gateway's IP address first.