Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Check for net access' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Check for net access
Authored by: ssevenup on Feb 13, '04 12:44:39AM

A collegue suggested the following...

en0status=`ifconfig en0 | /usr/bin/awk '/status: active/ {print $1}'`
en1status=`ifconfig en1 | /usr/bin/awk '/status: active/ {print $1}'`

if [ $en0status ] || [ $en1status ]; then

This way if you run a CRON script it won't run when your connect bandwidth is low. Liveupdate via modem could really suck.


Mark Moorcroft
Sys. Admin.

[ Reply to This | # ]
Check for net access
Authored by: jlevitsk on Apr 02, '04 12:58:28PM

That's awesome. I will probably switch to your check for eth0 or eth1 being up before doing a dig. I'll still do the dig because it's possible you can see an airport that doesn't actually have public internet access.

Thanks much.

[ Reply to This | # ]