Patrik Stridvall wrote:

> > >   gomeisa[53]:~% /sbin/route -n ; uname -rs
> > >   /sbin/route: Command not found.
> > >   SunOS 5.6
> > >
> >
> > Okay, that's odd. Where do they hide the route command
>
> In /usr/sbin/route. However route fails, since only root
> the sufficent permission to do this on Solaris.
>
> > A configure test of the route command would take care of the
> > differences nicely.
>
> If you search both /sbin and /usr/sbin, yes.
>
> > Can I assume that the grep part should work on any self
> > respecting UNIX ?
>
> Only if the user have sufficent permissions which,
> as I said, is not the case on Solaris.

Well, there is an easy solution to that problem.

First, try to use route because it will tell you if there is a connection
present (and will still be true even if it's not working correctly, which is
an advantage)

Failing that, fall back on a ping of codeweavers.com or something, or if a
URL is given, ping that address.

Or forget about ping altogether and just return TRUE if we have no idea
whether there is a default route or not.

-Dave

Reply via email to