Date: Fri, 11 Oct 2013 21:12:48 +0000 (UTC) From: Devin Teske <dteske@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256347 - head/usr.sbin/bsdinstall/scripts Message-ID: <201310112112.r9BLCmWH019103@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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@wonkity.com> Reviewed by: Allan Jude <freebsd@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 "
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310112112.r9BLCmWH019103>