James Carlson wrote:
> Roland Mainz writes:
> > -                     set -- `/usr/sbin/route -n add default \
> > +                     x=`/usr/sbin/route -n add default \
> >                           -gateway $router`
> > -                     [ $? -ne 0 -a "x$5" = "x$route_IP:" ] \
> > +                        res=$?
> > +                        set -- $x
> > +                     [ ${res} -ne 0 -a "x$5" = "x$route_IP:" ] \
> >                           && do_delete=no
> 
> I think that still leaves us with some mysteries, such as why the
> original poster's system "works."

Chris: ping!

> Does he have junk in his
> /etc/defaultrouter file that we just didn't previously detect?
> 
> Did something get broken in /usr/sbin/route such that it doesn't
> return error codes properly?

The only thing my patch "fixes" is the return value propagation of the
"route" command. On my B61 VMware machine it returns a non-zero value
which the Bourne shell "set" command seems to "pass through" in some
weired cases and that is what the script seems to expect. The patch
above moves the call to "route" into a seperate line (storing the
resulting output in "x"), explicitly fetches the return value and stores
it in "res" and then calls "set" with the value of "x".

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) [EMAIL PROTECTED]
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 7950090
 (;O/ \/ \O;)
_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to