Add Hotspot 2.0 Support flag

This commit is contained in:
Phani Pavan K 2023-09-28 11:42:00 +05:30
parent 73441c4ed3
commit 0acb16dbaa
1 changed files with 12 additions and 2 deletions

View File

@ -103,7 +103,8 @@ Options:
(defaults to /etc/hostapd/hostapd.accept) (defaults to /etc/hostapd/hostapd.accept)
--hostapd-debug <level> 1 or 2. Passes -d or -dd to hostapd --hostapd-debug <level> 1 or 2. Passes -d or -dd to hostapd
--isolate-clients Disable wifi communication between clients --isolate-clients Disable wifi communication between clients
--hs20 Enable Hotspot 2.0 (Make sure your hostapd build supports it)
--ieee80211n Enable IEEE 802.11n (HT) --ieee80211n Enable IEEE 802.11n (HT)
--ieee80211ac Enable IEEE 802.11ac (VHT) --ieee80211ac Enable IEEE 802.11ac (VHT)
--ht_capab <HT> HT capabilities (default: [HT40+]) --ht_capab <HT> HT capabilities (default: [HT40+])
@ -180,7 +181,8 @@ define_global_variables(){
HIDDEN=0 # hidden wifi hotspot HIDDEN=0 # hidden wifi hotspot
WIFI_IFACE= WIFI_IFACE=
CHANNEL=default CHANNEL=default
FORCECHANNEL=0 FORCECHANNEL=0 # Forces channel provided by -c flag
HOTSPOT20=0 # For enabling Hotspot 2.0
WPA_VERSION=2 WPA_VERSION=2
MAC_FILTER=0 MAC_FILTER=0
MAC_FILTER_ACCEPT=/etc/hostapd/hostapd.accept MAC_FILTER_ACCEPT=/etc/hostapd/hostapd.accept
@ -379,6 +381,10 @@ parse_user_options(){
shift shift
FORCECHANNEL=1 FORCECHANNEL=1
;; ;;
--hs20)
shift
HOTSPOT20=1
;;
-w) -w)
shift shift
WPA_VERSION="$1" WPA_VERSION="$1"
@ -1754,6 +1760,10 @@ write_hostapd_conf() {
EOF EOF
fi fi
if [[ $HOTSPOT20 -eq 1 ]]; then
echo "hs20=1" >> "$CONFDIR/hostapd.conf"
fi
if [[ $IEEE80211N -eq 1 ]]; then if [[ $IEEE80211N -eq 1 ]]; then
cat <<- EOF >> "$CONFDIR/hostapd.conf" cat <<- EOF >> "$CONFDIR/hostapd.conf"
ieee80211n=1 ieee80211n=1