mirror of
https://github.com/opnsense/src.git
synced 2026-04-22 14:49:36 -04:00
eliminate hardwired lists; use the media type to autoconfig
This commit is contained in:
parent
0c099281a3
commit
ca5ccaea7c
1 changed files with 17 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue