fbsd.questions at rachie.is-a-geek.net
Mon May 12 20:20:51 UTC 2008
On Monday 12 May 2008 18:34:32 Wojciech Puchar wrote:
> is there an option in dhclient (or other program) to try getting IP
> address but - don't set anything in system.
> i mean something to just check for dhcp servers.
> or maybe something that just detects what DHCP servers are available.
The largely undocumented dhclient_exit|enter_hooks are suitable for this. Look
at the source of /sbin/dhclient-script.
In short, if you set exit_status to non-zero in /etc/dhclient-enter-hooks,
nothing will be set. Some environment variables will be available to you,
among which should be the ip of the dhcp server that responded. If you simply
dump the env to stdout, you will see things available.
Problem with today's modular software: they start with the modules
and never get to the software part.
More information about the freebsd-questions