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

Quick way to tell if online for use in cron script?



Hi debian-users,

I wanted to run 'ntpdate' periodically via a cron script.  However, I
would prefer if the script would only run ntpdate if I am online (my
dialup account), in order to avoid filling up my logs with 'can't find
xxx.xxx.xxx.xxx' messages.  Is there something in /proc or a simple
command that I could use to tell whether I'm dialed up?  Currently I
am simply running 'ifconfig ppp0' to see if I'm online, but that seems
a little inelegant to me.

This is the line I'm using currently:

39 *     * * *     nobody  /sbin/ifconfig ppp0 &&
/etc/init.d/ntpdate start

Thanks,

=wl

-- 
Albert ``Willy'' Lee, Emacs user, game programmer
"They call me CRAZY - just because I DARE to DREAM of a RACE of 
SUPERHUMAN MONSTERS!"



Reply to: