wait a minute:
If the only thing you want to know is whether the PPP interface is up, you
can run the ifconfig utility. If the PPP port is alive, ifconfig will
report the fact.
Or do "grep ppp0: /dev/net/dev" and check the status return for whether PPP
is in the device table. If it's activity you are interested in, the
counter in /dev/net/dev would tell you what you need to know when you parse
out the transmit and receive counters.
At 03:25 PM 2/2/00 , Tim Fletcher wrote:
> > >I am writing a small linux application and at some point i want to
> know if
> > >the user is hooked to the internet. how can i tell if the user has
> > >internet access at the moment ????
> >
> > You could check to see if a default route is present.
>
>All my machines have a default route set, but there is only an
>"internet" connection when the modem (in a remote firewall) is dialed up.
>
>I think that the ping idea (or try a small tcp connection to a know good
>host) is best, as even a DNS lookup (something I wondered about) could
>give false positives with a caching nameserver.
>
>--
>
> Tim Fletcher .~.
> /V\ L I N U X
> [EMAIL PROTECTED] // \\ >Don't fear the penguin<
> [EMAIL PROTECTED] /( )\
> ^^-^^
>
>Catapultam habeo. Nisi pecuniam omnem mihi dabis, ad caput tuum saxum
>immane mittam (For non-latiners: "I have a catapult. Give me all the
>money, or I will fling an enormous rock at your head.")
>
>-
>To unsubscribe from this list: send the line "unsubscribe linux-net" in
>the body of a message to [EMAIL PROTECTED]
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]