- local start_hostapd=
- rm -f /var/run/hostapd-$phy.conf
- for vif in $vifs; do
- config_get mode "$vif" mode
- [ "$mode" = "ap" ] || continue
- mac80211_hostapd_setup_bss "$phy" "$vif"
- start_hostapd=1
- done
-
- [ -n "$start_hostapd" ] || return 0
-
- hostapd -P /var/run/wifi-$phy.pid -B /var/run/hostapd-$phy.conf || {
- echo "Failed to start hostapd for $phy"
- return
- }
- sleep 2
-
- for vif in $vifs; do
- config_get mode "$vif" mode
- config_get ifname "$vif" ifname
- [ "$mode" = "ap" ] || continue
- mac80211_start_vif "$vif" "$ifname"
- done