quoth the Jorge Almeida:
> Anyone knows how is the file /etc/dhcpc/dhcpcd-eth0.info updated?

This file is updated by your dhcp client, in your case it would appear to be 
dhcpcd. It should be updated everytime you reconnect to your ISP, or when 
your dhcp lease runs out (the length of lease time depends on the ISP).

> I have a cable connection with dynamic IP, and the contents of the IP
> line in /etc/dhcpc/dhcpcd-eth0.info match my *former* IP, not the
> current one. And there exists a file /etc/dhcpc/dhcpcd-eth0.info.old,
> which makes it a bit more confusing.
> My modem was refusing to register (only red light on), so I made a hard
> reset and it works now. Could this be related with the stale information
> in /etc/dhcpc/dhcpcd-eth0.info?

Perhaps...the fact this file is not getting updated is worrisome. It may be a 
problem with dhcpcd, or maybe with your ISP itself. Some ISPs may cut you off 
if you change nic cards (ie: MAC address is different..). Not sure what your 
particular problem may be.

> (And by the way, what is the proper way to find the current IP in a
> script? I'm just greping the output of ifconfig, but is there some more
> direct way? I thought that reading dhcpcd-eth0.info would do it, but
> apparently not.)

Not sure there is a proper way. When I need my IP address for a script I 
usually use:
IP=$(ifconfig eth0 | grep inet | sed 's/inet addr://g' | awk '{print $1}')

-d
-- 
darren kirby :: Part of the problem since 1976 :: http://badcomputer.org
"...the number of UNIX installations has grown to 10, with more expected..."
- Dennis Ritchie and Ken Thompson, June 1972

Attachment: pgpusGRVJHpzZ.pgp
Description: PGP signature

Reply via email to