Jorge Almeida wrote:

Anyone knows whether the current (dynamical) IP is stored in some text
file?
I know I can find the IP with ifconfig, but if the value were stored in
some file I could setup a service to monitor the file for changes and
take appropriate actions on change of IP.

A simple solution might be to write something in the postup() and postdown() functions in /etc/conf.d/net.

For something more complicated, if you use the dhclient program from the dhcp package as your DHCP client, you can modify /etc/dhcp/dhclient-exit-hooks script to do whatever you would like whenever the DHCP client changes something (due to a release, renew, etc). I use it to dynamically setup WINS servers and DNS forwarders for whatever network I am plugged into. In this script you will have access to all DHCP options provided by the DHCP server.

-Richard

--
gentoo-user@gentoo.org mailing list

Reply via email to