how do I run fetchmail only if the laptop is connected?(ubuntu)

Kevin Cozens kevin-4dS5u2o1hCn3fQ9qLvQP4Q at public.gmane.org
Fri Feb 29 23:20:53 UTC 2008


Peter Smerdon wrote:
> However on my ubuntu laptop there is no such file /etc/network/ifstate,
> I am not sure if it is because I am using NetworkManager or because it
> simply does not exist in ubuntu. So, I just need to know how to tell if
> either wlan0 or eth0 is up. Any advice? 

You could always parse the output of ifconfig for wlan0 and eth0. If you can't 
find the string "UP" in one of them, you don't have a network connection.

-- 
Cheers!

Kevin.

http://www.ve3syb.ca/           |"What are we going to do today, Borg?"
Owner of Elecraft K2 #2172      |"Same thing we always do, Pinkutus:
                                 |  Try to assimilate the world!"
#include <disclaimer/favourite> |              -Pinkutus & the Borg
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list