On Sat, 01 Feb 2003 15:14, Col wrote:
> Christopher Sawtell wrote:
> > On Fri, 31 Jan 2003 18:01, Col wrote:
> >>Is there an easier/better way for a user to obtain ppp0 ip address than
> >>
> >>IP=$(netstat -rn | grep UH | cut -d" " -f1 | head -n 1)
> >
> > Quoting the pppd man page
> >
> > /etc/ppp/ip-up
> > A program or script which is executed when the link
> > is available for sending and receiving IP packets
> > (that is, IPCP has come up). It is executed with
> > the parameters
> >
> > interface-name tty-device speed local-IP-address
> > remote-IP-address ipparam
> >
> > So, inside that script, the variable $4 will contain the IP-address you
> > isp has alotted to you.
> >
> > Is that what you wanted?
>
> That would make it easy! I tried
>
> echo $4
>
> but it displayed nothing (redhat 8)
It's a daemon initiated process so there is no STDOUT
try:-
echo $4 > /tmp/current_IP_Number
or perhaps
cp /dev/null /tmp/all_ppp_parameters # get rid of whats there already.
until [ -z "$1" ] # Loop until all parameters done...
do
echo "$1" >> /tmp/all_ppp_parameters
shift
done
--
Sincerely etc.,
Christopher Sawtell