Date: Sat, 9 Aug 2003 10:35:21 +0200 (CEST) From: Martin Blapp <mb@imp.ch> To: jhb@freebsd.org, "" <imp@imp.com>, "" <rwatson@freebsd.org>, Larry Rosenman <ler@lerctr.org> Cc: freebsd-mobile@freebsd.org Subject: Re: Make pccard.ether working if there is already a dhclient running Message-ID: <20030809103212.Y49451@cvs.imp.ch> In-Reply-To: <20030809004120.T49451@cvs.imp.ch> References: <20030809004120.T49451@cvs.imp.ch>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030809103212.Y49451>