iwconfig "$ifname" enc "[$idx]" "${key:-off}"
done
config_get key "$vif" key
- iwconfig "$ifname" enc "${key:-1}"
+ key="${key:-1}"
+ case "$key" in
+ [1234]) iwconfig "$ifname" enc "[$key]";;
+ *) iwconfig "$ifname" enc "$key";;
+ esac
;;
PSK|psk|PSK2|psk2)
config_get key "$vif" key
*)
config_get ssid "$vif" ssid
;;
+ adhoc)
+ config_get addr "$vif" bssid
+ [ -z "$addr" ] || {
+ iwconfig "$ifname" ap "$addr"
+ }
+ ;;
esac
[ "$mode" = "sta" ] && {
#add wpa_supplicant calls here
;;
esac
- net_cfg="$(find_net_config "$vif")"
- [ -z "$net_cfg" ] || {
- bridge="$(bridge_interface "$net_cfg")"
- }
- wpa_supplicant ${bridge:+ -b $bridge} -Bw -D wext -i "$ifname" -c /var/run/wpa_supplicant-$ifname.conf
+ [ -z "$proto" ] || wpa_supplicant ${bridge:+ -b $bridge} -Bw -D wext -i "$ifname" -c /var/run/wpa_supplicant-$ifname.conf
;;
esac
first=0
detect_atheros() {
cd /proc/sys/dev
[ -d ath ] || return
- for dev in wifi*; do
+ for dev in $(ls -d wifi* 2>&-); do
config_get type "$dev" type
[ "$type" = atheros ] && return
cat <<EOF
# option rxantenna 0
# option distance 2000
# disable radio to prevent an open ap after reflashing:
- option radio 0
+ option disabled 1
config wifi-iface