On Tue, 24 Aug 1999 [EMAIL PROTECTED] wrote:

>    b) remote call via ssh.  Much more secure (no passwords in the clear),
>       though to be honest, I can't think of a way to capture the hosts
>       dynamic IP off the top of my head.  I'm sure someone else can help
>       you there...

On my Linux box (Mandrake 6) which uses pppd to dial in:
[root@fred /root]# /sbin/ifconfig --version
net-tools 1.52
ifconfig 1.39 (1999-03-18) 
(I believe the ifconfig output is the same across any semi-current
version, but just in case, that's what I'm using)

This will work:

echo `/sbin/ifconfig ppp0 | grep 'inet addr:' | cut -f 2 -d : | cut -f 1 -d ' '`

Or, if you're a little less masochistic (shell scripting-wise), 
the /etc/ppp/ip-up script has the IP address given to it as $4, so you
could just stick a:
echo $4 > /root/current_ip

in /etc/ppp/ip-up and then just do a `cat /root/current_ip` to get at it.
(the parameters passed to ip_up and ip_down are documented in pppd's man
page.

Hope this helps,
.Shawn

Reply via email to