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.
This commit is contained in:
digitalirony 2022-07-15 16:21:48 -07:00 committed by GitHub
parent 09a17a6571
commit 6459ef7fa7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -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.