Alex wrote:
> It's no need to send one e-mail multiple times, and please set your
> system date and time acordingly
> You can find out your ip address using a script like  this
>
> #!/bin/bash
> ip=`ifconfig ethX | grep "inet addr" | awk '{print $2}' | tr -d addr:`
> echo Your ip on ethX is $ip
>
> where X is the number of your ethernet interface that you want to find
> out its ip
>   
Just a little update on that script, to allow for non eth interfaces...

#!/bin/bash
ip=`ifconfig $1 | grep "inet addr" | awk '{print $2}' | tr -d addr:`
echo Your ip on $1 is $ip

This should allow for passing the interface, i.e. ./findip.sh eth0  or
if this is on a DHCP assigned address like a PPPoE, ./findh.sh ppp0.
I'm going to add it to my post-update script for my ppp0 interface to
update some routing tables, and to kludge in some DDNS entries...


Reply via email to