PERFORCE change 139611 for review
Sam Leffler
sam at FreeBSD.org
Tue Apr 8 19:35:02 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=139611
Change 139611 by sam at sam_ebb on 2008/04/08 19:34:22
grep is in /usr/bin; do it entirely in the shell (with help
from the peanut gallery)
Affected files ...
.. //depot/projects/vap/etc/rc.d/wpa_supplicant#5 edit
Differences ...
==== //depot/projects/vap/etc/rc.d/wpa_supplicant#5 (text+ko) ====
@@ -18,21 +18,29 @@
return 1
fi
+is_wired_interface()
+{
+ media=
+ ifconfig $1 2>/dev/null | while read line; do
+ case "$line" in
+ *media:*Ethernet*)
+ media="Ethernet"
+ ;;
+ esac
+ done
+ test -z "$media"
+}
+
case ${ifn} in
ndis*)
driver="ndis"
;;
*)
- t="`ifconfig $1 2>/dev/null | grep media:`"
- t=`expr "$t" : 'media: \([^ ]*\)'`
- case "$t" in
- Ethernet)
+ if is_wired_interface ${ifn} ; then
driver="wired"
- ;;
- *)
+ else
driver="bsd"
- ;;
- esac
+ fi
;;
esac
More information about the p4-projects
mailing list