svn commit: r256347 - head/usr.sbin/bsdinstall/scripts
Devin Teske
dteske at FreeBSD.org
Fri Oct 11 21:12:48 UTC 2013
Author: dteske
Date: Fri Oct 11 21:12:48 2013
New Revision: 256347
URL: http://svnweb.freebsd.org/changeset/base/256347
Log:
Incorporate PR bin/161547 to detect when an interface is wireless.
Patch from PR modified slightly for whitespace and style.
PR: bin/161547
Submitted by: Warren Block <wblock at wonkity.com>
Reviewed by: Allan Jude <freebsd at allanjude.com>
Approved by: re (glebius)
Modified:
head/usr.sbin/bsdinstall/scripts/netconfig
Modified: head/usr.sbin/bsdinstall/scripts/netconfig
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/netconfig Fri Oct 11 20:53:25 2013 (r256346)
+++ head/usr.sbin/bsdinstall/scripts/netconfig Fri Oct 11 21:12:48 2013 (r256347)
@@ -41,11 +41,19 @@ DIALOG_TAGS=""
: ${DIALOG_ITEM_HELP=4}
: ${DIALOG_ESC=255}
+# Do a dirty check to see if this a wireless interface -- there should be a
+# better way
+is_wireless_if() {
+ ifconfig $1 | grep -q 'media: IEEE 802.11 Wireless'
+}
+
for IF in `ifconfig -l`; do
test "$IF" = "lo0" && continue
(ifconfig -g wlan | egrep -wq $IF) && continue
INTERFACES="$INTERFACES $IF"
DESC=`sysctl -n dev.$(echo $IF | sed -E 's/([[:alpha:]]*)([[:digit:]]*)/\1.\2/g').%desc`
+ is_wireless_if $IF && echo $DESC |
+ grep -iqv wireless && DESC="Wireless $DESC"
DIALOG_TAGS="$DIALOG_TAGS $IF \"$DESC\""
done
@@ -63,10 +71,8 @@ exec 3>&-
: > $BSDINSTALL_TMPETC/._rc.conf.net
-# Do a dirty check to see if this a wireless interface -- there should be a
-# better way
IFCONFIG_PREFIX=""
-if ifconfig $INTERFACE | grep -q 'media: IEEE 802.11 Wireless'; then
+if is_wireless_if $INTERFACE; then
NEXT_WLAN_IFACE=wlan0 # XXX
echo wlans_$INTERFACE=\"$NEXT_WLAN_IFACE\" >> $BSDINSTALL_TMPETC/._rc.conf.net
IFCONFIG_PREFIX="WPA "
More information about the svn-src-all
mailing list