Re: Make pccard.ether working if there is already a dhclient running

Martin Blapp <[email protected]>
Newsgroups gmane.os.freebsd.devel.mobile
Message-ID <[email protected]>
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
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-mobile
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.