Hi,

On Tue, Jun 28, 2005 at 07:31:22PM +0200, Frederic LEHOBEY wrote:
...
> Please notice that in the file F31routes.rul I believe the variable i
> should be substituted to the j (see the patch below) for the latter
> `if' test to make sense.
> 
> ----------------------------------------------------------------------
> diff -Naur /usr/share/doc/ipmasq/examples/routes/F31routes.rul 
> /tmp/ipmasq-309629/F31routes.rul
> --- /usr/share/doc/ipmasq/examples/routes/F31routes.rul       2004-07-27 
> 21:37:24.000000000 +0200
> +++ /tmp/ipmasq-309629/F31routes.rul  2005-06-28 18:41:03.711288480 +0200
> @@ -1,10 +1,10 @@
>  #: Forward packets among internal and routed networks
>  if [ -n "$ROUTES" ]; then
>      for route in $ROUTES; do
> -     j=${$route%%:*}
> +     j=${route%%:*}
>       dest=${route##*:}
>       for r in $ROUTES; do 
> -         j=${$r%%:*}
> +         i=${r%%:*}
>           src=${r##*:}
>              if [ "$i" != "$j" ]; then
>                  case $MASQMETHOD in
> ----------------------------------------------------------------------

This looks good. Thanks I will take this :-)

> Just for the record my alternative patch to A01routes.rul is also
> included below.
> 
> ----------------------------------------------------------------------
> diff -Naur /usr/share/doc/ipmasq/examples/routes/A01routes.rul 
> /tmp/ipmasq-309629/A01routes.rul
> --- /usr/share/doc/ipmasq/examples/routes/A01routes.rul       2004-07-28 
> 22:51:24.000000000 +0200
> +++ /tmp/ipmasq-309629/A01routes.rul  2005-06-28 18:41:03.711288480 +0200
> @@ -18,9 +18,11 @@
>      return
>  }
>  
> -for route in `route -n | grep '^[1-9]'`; do
> +routelines=`route -n | grep '^[1-9]'`
> +for (( i=1 ; $i <= `echo "$routelines" | wc -l` ; i++ )) do
> +    route=`echo "$routelines" | head -n $i | tail -n 1`
>      IFACE=$( echo $route | { read X X X X X X X Y ; echo $Y ; } )
> -            if echo $INTERNAL | grep -q $IFACE; then
> +            if `echo $INTERNAL | grep -q $IFACE -` ; then
>                  # $IFACE is in $INTERNAL
>                  NDEST=$( echo $route | { read Y X X X X X X X ; echo $Y ; } )
>                  NMASK=$( echo $route | { read X X Y X X X X X ; echo $Y ; } )
> ----------------------------------------------------------------------

Oops.  Yopu are right.  This could not work.  But I need to confirm few
things. I have question on this patch. 

> -            if echo $INTERNAL | grep -q $IFACE; then
> +            if `echo $INTERNAL | grep -q $IFACE -` ; then

First, I think grep do not need '-' as file name.  
My original script should work.  It is testing exit code of grep.

Can you tell me why this patch?

> Otherwise, I have the same typos for files I31routes.rul, M71masq.rul
> and O31routes.rul as original bug submitter (not included).

Give them to me.



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to