1 |
Jorge Almeida wrote: |
2 |
|
3 |
>Anyone knows whether the current (dynamical) IP is stored in some text |
4 |
>file? |
5 |
>I know I can find the IP with ifconfig, but if the value were stored in |
6 |
>some file I could setup a service to monitor the file for changes and |
7 |
>take appropriate actions on change of IP. |
8 |
> |
9 |
> |
10 |
|
11 |
A simple solution might be to write something in the postup() and |
12 |
postdown() functions in /etc/conf.d/net. |
13 |
|
14 |
For something more complicated, if you use the dhclient program from the |
15 |
dhcp package as your DHCP client, you can modify |
16 |
/etc/dhcp/dhclient-exit-hooks script to do whatever you would like |
17 |
whenever the DHCP client changes something (due to a release, renew, |
18 |
etc). I use it to dynamically setup WINS servers and DNS forwarders for |
19 |
whatever network I am plugged into. In this script you will have access |
20 |
to all DHCP options provided by the DHCP server. |
21 |
|
22 |
-Richard |
23 |
|
24 |
-- |
25 |
gentoo-user@g.o mailing list |