Re: Updating /etc/hosts automatically / behavior of sed command
On 24 Dec 1999, John Hasler wrote:
> Raphaël HALIMI writes:
> > Fed up with changing my /etc/hosts file by hand each time my IP adress
> > changes (my ISP's server isn't totally stable, and sometimes my IP
> > changes even if I don't reboot),...
> Why do you feel that you need to have your IP address in your /etc/hosts?
> > CURRENT_IP=`/sbin/ifconfig $INTERFACE | grep inet | cut -d ":" -f 2 | cut -d " " -f 1`
> CURRENT_IP=`/sbin/route -n | grep $INTERFACE | cut -d ' ' -f 1`
For me, this (second command) gives the IP of the remote site, not of my
machine. The original command correctly gives the IP of the local end of
That said, I'm still unsure as to why this needs to be in /etc/hosts ...
| oOOooO /
--| oOobodoO / email@example.com : http://dsb3.com
--| ooOoOo /
| II / The wise man tells you where you have fallen
| II / and where you may fall - Invaluable secrets.