From owner-freebsd-mobile@FreeBSD.ORG Sat Aug 9 01:35:33 2003 Return-Path: Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5031F37B401; Sat, 9 Aug 2003 01:35:33 -0700 (PDT) Received: from mail.imp.ch (mail.imp.ch [157.161.1.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 04F1543F3F; Sat, 9 Aug 2003 01:35:32 -0700 (PDT) (envelope-from mb@imp.ch) Received: from nbs.imp.ch (nbs.imp.ch [157.161.4.7]) by mail.imp.ch (8.12.6p2/8.12.3) with ESMTP id h798ZLYc062128; Sat, 9 Aug 2003 10:35:23 +0200 (CEST) (envelope-from Martin.Blapp@imp.ch) Received: from cvs.imp.ch (cvs.imp.ch [157.161.4.9]) by nbs.imp.ch (8.12.8/8.12.3) with ESMTP id h798ZLlH8808892; Sat, 9 Aug 2003 10:35:21 +0200 (MES) Date: Sat, 9 Aug 2003 10:35:21 +0200 (CEST) From: Martin Blapp To: jhb@freebsd.org, "" , "" , Larry Rosenman In-Reply-To: <20030809004120.T49451@cvs.imp.ch> Message-ID: <20030809103212.Y49451@cvs.imp.ch> References: <20030809004120.T49451@cvs.imp.ch> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-mobile@freebsd.org Subject: Re: Make pccard.ether working if there is already a dhclient running X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Aug 2003 08:35:33 -0000 Here is a simplified patch. It should work too if dhclient has been manually started, or if more than one pccard device has been used. --- /etc/pccard_ether Thu Jun 26 04:44:08 2003 +++ /etc/pccard_ether Sat Aug 9 10:29:52 2003 @@ -10,13 +10,23 @@ stop_dhcp() { if [ -s /var/run/dhclient.${interface}.pid ]; then pidfile="/var/run/dhclient.${interface}.pid" + restart="/etc/rc.d/dhclient start" elif [ -s /var/run/dhcpc.${interface}.pid ]; then pidfile="/var/run/dhcpc.${interface}.pid" + restart="/etc/rc.d/dhclient start" + elif [ -s /var/run/dhclient.pid ]; then + eval _cooked_list=\"`/bin/ps -xwwww | \ + /usr/bin/grep dhclient | \ + /usr/bin/grep -v grep | \ + /usr/bin/sed -e 's|^.*dhclient||'`\" + pidfile="/var/run/dhclient.pid" + restart="" else return fi kill `cat ${pidfile}` rm -f ${pidfile} + sh `$restart` } start_dhcp() { @@ -35,7 +44,7 @@ pidfile="/var/run/dhclient.${interface}.pid" dhclient_flags="${dhclient_flags} -pf ${pidfile}" fi - ${dhclient_program} ${dhclient_flags} ${interface} + ${dhclient_program} ${dhclient_flags} $_cooked_list ${interface} else echo "${dhclient_program}: DHCP client software not available" fi