From owner-p4-projects@FreeBSD.ORG Thu Dec 2 22:50:26 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9E96916A4F8; Thu, 2 Dec 2004 22:50:26 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 78BA616A4F4 for ; Thu, 2 Dec 2004 22:50:26 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6C5D543D49 for ; Thu, 2 Dec 2004 22:50:26 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id iB2MoQQC012731 for ; Thu, 2 Dec 2004 22:50:26 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id iB2MoQF1012728 for perforce@freebsd.org; Thu, 2 Dec 2004 22:50:26 GMT (envelope-from sam@freebsd.org) Date: Thu, 2 Dec 2004 22:50:26 GMT Message-Id: <200412022250.iB2MoQF1012728@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 66281 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2004 22:50:27 -0000 http://perforce.freebsd.org/chv.cgi?CH=66281 Change 66281 by sam@sam_ebb on 2004/12/02 22:49:59 more stuff from old script: o don't clobber default route when adding a new address; this maintains old behaviour o set hostname if we're supplied a name Affected files ... .. //depot/projects/wifi/sbin/dhclient/dhclient-script#4 edit Differences ... ==== //depot/projects/wifi/sbin/dhclient/dhclient-script#4 (text+ko) ==== @@ -32,6 +32,18 @@ # Helper functions that implement common actions. # +check_hostname() { + current_hostname=`$HOSTNAME` + if [ -z "$current_hostname" ]; then + $LOGGER "New Hostname: $new_host_name" + $HOSTNAME $new_host_name + elif [ "$current_hostname" = "$old_host_name" -a \ + "$new_host_name" != "$old_host_name" ]; then + $LOGGER "New Hostname: $new_host_name" + $HOSTNAME $new_host_name + fi +} + delete_old_address() { if [ -n "$old_ip_address" ]; then ifconfig $interface inet -alias $old_ip_address $medium @@ -86,7 +98,6 @@ } add_new_routes() { - route delete default >/dev/null 2>&1 for router in $new_routers; do if [ "$new_ip_address" = "$router" ]; then route add default -iface $router >/dev/null 2>&1 @@ -185,6 +196,7 @@ ;; BOUND|RENEW|REBIND|REBOOT) + check_hostname if [ -n "$old_ip_address" ]; then if [ "$old_ip_address" != "$alias_ip_address" ]; then delete_old_alias