diff options
author | sam <sam@FreeBSD.org> | 2008-09-21 00:26:13 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2008-09-21 00:26:13 +0000 |
commit | d151c8281b764b14db2df2e8c00c35ef4f6c2901 (patch) | |
tree | b1bcd2af8a62bd03eeb98e04b375166716af5f8e | |
parent | 96088079e9423afdfe848a84a64b47524a619d1a (diff) | |
download | FreeBSD-src-d151c8281b764b14db2df2e8c00c35ef4f6c2901.zip FreeBSD-src-d151c8281b764b14db2df2e8c00c35ef4f6c2901.tar.gz |
eliminate hardwired lists; use the media type to autoconfig
-rw-r--r-- | tools/tools/net80211/scripts/config | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/tools/tools/net80211/scripts/config b/tools/tools/net80211/scripts/config index cff9134..e501bc0 100644 --- a/tools/tools/net80211/scripts/config +++ b/tools/tools/net80211/scripts/config @@ -4,17 +4,31 @@ # $FreeBSD$ # +media_type() +{ + ifconfig $1 2>/dev/null | while read line; do + case "$line" in + *media:?Ethernet*) + echo 802.3 + ;; + *media:?IEEE?802.11*) + echo 802.11 + ;; + esac + done +} + # # Auto-detect WIRED and WIRELESS. # NB: takes first device of each type; to fix # either specify them before . config. # for i in `ifconfig -l`; do - case $i in - bge*|em*|re*|nfe*|fxp*|vr*|msk*|tx*|dc*) + case `media_type $i` in + 802.3) test -z "$WIRED" && WIRED=$i ;; - ath*|ral*|zyd*|ural*|rum*|bwi*) + 802.11) test -z "$WIRELESS" && WIRELESS=$i ;; esac |