At 11:05 14/12/2001 +0000, you wrote:
>On Fri, 14 Dec 2001, Pierre Emmanuel Brinette wrote:
>
> >
> > The use of the peer IP is a good idea, but your script only work when you
> > have only *ONE* interface using P-t-P. In the case of you use a GRE tunnel
> > or a VPN, this command return an IP adress each time it find one.
> >
> > I have had this problem so I have made this command :
> >
> > TEST_ADDR=`ifconfig | awk '{ /^ppp0/ && A=FNR; if (FNR == A+1) VAL=$0  }
> >          END { $0=VAL;  print $3 }'  | grep "P-t-P" | cut -d":" -f2`
> >
>
>Just use /sbin/ifconfig ppp0 and then there will only be the information for
>ppp0 present.
>
> > >PEER_IP=`/sbin/ifconfig ppp0 | grep P-t-P | cut -d ':' -f 3 | cut -d ' 
> ' -f 1`
>

Yep, but in the case of you have ppp compiled in the kernel (not as module) 
and that pppd is down, the adress returned by this command is 0.0.0.0. If 
you ping this adress, it is like pinging 127.0.0.1.

Pierre Emm.



Liste de diffusion modem ALCATEL SpeedTouch USB
Pour se désinscrire : mailto:[EMAIL PROTECTED]?subject=unsubscribe

        

Reply via email to