From owner-svn-src-stable@FreeBSD.ORG  Tue Sep 21 07:43:56 2010
Return-Path: <owner-svn-src-stable@FreeBSD.ORG>
Delivered-To: svn-src-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ED129106566C;
	Tue, 21 Sep 2010 07:43:56 +0000 (UTC)
	(envelope-from brian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DBA7B8FC17;
	Tue, 21 Sep 2010 07:43:56 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8L7huVV083696;
	Tue, 21 Sep 2010 07:43:56 GMT (envelope-from brian@svn.freebsd.org)
Received: (from brian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8L7huVn083694;
	Tue, 21 Sep 2010 07:43:56 GMT (envelope-from brian@svn.freebsd.org)
Message-Id: <201009210743.o8L7huVn083694@svn.freebsd.org>
From: Brian Somers <brian@FreeBSD.org>
Date: Tue, 21 Sep 2010 07:43:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r212955 - stable/8/sbin/dhclient
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
	<svn-src-stable.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-stable>, 
	<mailto:svn-src-stable-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-stable>
List-Post: <mailto:svn-src-stable@freebsd.org>
List-Help: <mailto:svn-src-stable-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-stable>,
	<mailto:svn-src-stable-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 21 Sep 2010 07:43:57 -0000

Author: brian
Date: Tue Sep 21 07:43:56 2010
New Revision: 212955
URL: http://svn.freebsd.org/changeset/base/212955

Log:
  MFC r212253: Document how to use dhclient-{enter,exit}-hooks.
  
  PR:		149351

Modified:
  stable/8/sbin/dhclient/dhclient-script.8
Directory Properties:
  stable/8/sbin/dhclient/   (props changed)

Modified: stable/8/sbin/dhclient/dhclient-script.8
==============================================================================
--- stable/8/sbin/dhclient/dhclient-script.8	Tue Sep 21 07:03:53 2010	(r212954)
+++ stable/8/sbin/dhclient/dhclient-script.8	Tue Sep 21 07:43:56 2010	(r212955)
@@ -38,7 +38,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 1, 1997
+.Dd September 6, 2010
 .Dt DHCLIENT-SCRIPT 8
 .Os
 .Sh NAME
@@ -218,6 +218,29 @@ if it has reason to believe they are val
 If not, it should exit with a nonzero value.
 .El
 .Pp
+Before taking action according to
+.Va $reason ,
+.Nm
+will check for the existence of
+.Pa /etc/dhclient-enter-hooks .
+If found, it will be sourced
+.Pq see Xr sh 1 .
+After taking action according to
+.Va $reason ,
+.Nm
+will check for the existence of
+.Pa /etc/dhclient-exit-hooks .
+If found, it will be sourced
+.Pq see Xr sh 1 .
+These hooks scripts can be used to dynamically modify the enviornment at
+appropriate times during the DHCP negotiations.
+For example, if the administrator wishes to disable alias IP numbers on
+the DHCP interface, they might want to put the following in
+.Pa /etc/dhclient-enter-hooks :
+.Bd -literal -offset indent
+[ ."$reason" = .PREINIT ] && ifconfig $interface 0.0.0.0
+.Ed
+.Pp
 The usual way to test a lease is to set up the network as with
 .Li REBIND
 (since this may be called to test more than one lease) and then ping
@@ -239,6 +262,7 @@ but current scripts do not do this.
 .\" and bear the names of the operating systems on which they are intended
 .\" to work.
 .Sh SEE ALSO
+.Xr sh 1 ,
 .Xr dhclient.conf 5 ,
 .Xr dhclient.leases 5 ,
 .Xr dhclient 8 ,