From 6459ef7fa7a1fe950b23a0c0ba3ae9e085d9a4f4 Mon Sep 17 00:00:00 2001 From: digitalirony Date: Fri, 15 Jul 2022 16:21:48 -0700 Subject: [PATCH] Update hostapd.sh We should set the hardware mode based on the channel that is selected. Some cards/chipsets/drivers can accurately guess this, but some can not, by setting it explicitly we broaden the hardware supported. --- lib/ap/hostapd.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ap/hostapd.sh b/lib/ap/hostapd.sh index fd07f27..36f4ed9 100755 --- a/lib/ap/hostapd.sh +++ b/lib/ap/hostapd.sh @@ -54,13 +54,14 @@ function ap_service_prep() { APServiceChannel=$5 ap_service_stop - + if [[ $APServiceChannel <= 11 ]]; then HardwareMode="g"; else HardwareMode="a"; fi # Prepare the hostapd config file. echo "\ interface=$APServiceInterface driver=nl80211 ssid=$APServiceSSID -channel=$APServiceChannel" \ +channel=$APServiceChannel +hw_mode=$HardwareMode" \ > "$APServiceConfigDirectory/$APServiceMAC-hostapd.conf" # Spoof virtual interface MAC address.