- [ -f /proc/net/wl0 ] || return
- config_get type wl0 type
- [ "$type" = broadcom ] && return
- cat <<EOF
-config wifi-device wl0
+ local i=-1
+
+ while grep -qs "^ *wl$((++i)):" /proc/net/dev; do
+ config_get type wl${i} type
+ [ "$type" = broadcom ] && continue
+ cat <<EOF
+config wifi-device wl${i}