From owner-freebsd-questions@FreeBSD.ORG Mon May 12 20:20:51 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81E961065671 for ; Mon, 12 May 2008 20:20:51 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from snoogles.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id 58BD98FC26 for ; Mon, 12 May 2008 20:20:51 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from localhost (localhost [127.0.0.1]) by snoogles.rachie.is-a-geek.net (Postfix) with ESMTP id 37D231CDA5; Mon, 12 May 2008 12:20:50 -0800 (AKDT) From: Mel To: freebsd-questions@freebsd.org Date: Mon, 12 May 2008 21:59:58 +0200 User-Agent: KMail/1.9.7 References: <20080512183319.K82433@wojtek.tensor.gdynia.pl> In-Reply-To: <20080512183319.K82433@wojtek.tensor.gdynia.pl> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200805122159.59596.fbsd.questions@rachie.is-a-geek.net> Cc: Wojciech Puchar Subject: Re: dummy dhclient X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2008 20:20:51 -0000 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. -- Mel Problem with today's modular software: they start with the modules and never get to the software part.