This commit is contained in:
Phani Pavan Kambhampati 2025-07-28 16:01:14 +05:30 committed by GitHub
commit 5052e3695a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 59 additions and 19 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
VERSION=0.8.0-unstable2
VERSION=0.8.0-unstable3
PROGNAME="$(basename "$0")"
export LC_ALL=C
@ -101,8 +101,9 @@ Options:
(defaults to /etc/hostapd/hostapd.accept)
--hostapd-debug <level> 1 or 2. Passes -d or -dd to hostapd
--isolate-clients Disable wifi communication between clients
--idle-timeout <time> Idle timeout (in seconds) to disconnect a client device
--no-haveged Do not run haveged automatically when needed
--hs20 Enable Hotspot 2.0
--hs20 (ß) Enable Hotspot 2.0
WiFi 4 (802.11n) configs:
--wifi4 Enable IEEE 802.11n (HT)
@ -125,7 +126,7 @@ Options:
(second 80MHz) segment. Use with '--vht-ch-width 3'
WiFi 6 (802.11ax) configs:
--wifi6 Enable IEEE 802.11ax (HE)
--wifi6 (ß) Enable IEEE 802.11ax (HE)
--req-he Require station HE (High Efficiency) mode
--he-ch-width <index> Index of HE channel width:
@ -137,6 +138,13 @@ Options:
segment. Use with '--he-ch-width'
--he-seg1-ch <channel> Channel index of HE center frequency for secondary
(second 80MHz) segment. Use with '--he-ch-width 3'
--he-su-bfe (beta) Enable HE Single User Beamformee support
--he-su-bfr (beta) Enable HE Single User Beamformer support
--he-mu-bfr (beta) Enable HE Multi User Beamformer support
--enable-twt (beta) (ß) Enable Peer to Peer Target Wake Time support
(ß): Requires hostapd built with specific build flags enabled
Instance managing:
--daemon Run in background
@ -209,6 +217,7 @@ define_global_variables(){
WPA_VERSION=2
MAC_FILTER=0
MAC_FILTER_ACCEPT=/etc/hostapd/hostapd.accept
IDLETIMEOUT=300
IEEE80211N=0
REQUIREHT=0
IEEE80211AC=0
@ -223,6 +232,10 @@ define_global_variables(){
HECHANNELWIDTH=0
HESEG0CHINDEX=0
HESEG1CHINDEX=0
HESUBFE=0
HESUBFR=0
HEMUBFR=0
HEP2PTWT=0
DRIVER=nl80211
NO_VIRT=0 # not use virtual interface
COUNTRY=
@ -291,8 +304,6 @@ parse_user_options(){
SHARE_METHOD=redsocks
shift
;;
-g)
shift
GATEWAY4="$1"
@ -321,7 +332,6 @@ parse_user_options(){
shift
MAC_USE_RANDOM=1
;;
--dns)
shift
DNS="$1"
@ -371,12 +381,10 @@ parse_user_options(){
shift
DNS_NOCACHE=1
;;
--isolate-clients)
shift
ISOLATE_CLIENTS=1
;;
--ap)
shift
WIFI_IFACE="$1"
@ -393,8 +401,6 @@ parse_user_options(){
shift
QR=1
;;
--hidden)
shift
HIDDEN=1
@ -408,7 +414,6 @@ parse_user_options(){
MAC_FILTER_ACCEPT="$1"
shift
;;
-c)
shift
CHANNEL="$1"
@ -424,7 +429,11 @@ parse_user_options(){
[[ "$WPA_VERSION" == "2+1" ]] && WPA_VERSION=1+2
shift
;;
--idle-timeout)
shift
IDLETIMEOUT="$1"
shift
;;
--wifi4|--ieee80211n)
shift
IEEE80211N=1
@ -489,6 +498,22 @@ parse_user_options(){
HESEG1CHINDEX="$1"
shift
;;
--he-su-bfe)
shift
HESUBFE=1
;;
--he-su-bfr)
shift
HESUBFR=1
;;
--he-mu-bfr)
shift
HEMUBFR=1
;;
--enable-twt)
shift
HEP2PTWT=1
;;
--driver)
shift
DRIVER="$1"
@ -503,7 +528,6 @@ parse_user_options(){
VIRT_NAME="$1"
shift
;;
--country)
shift
COUNTRY="$1"
@ -534,7 +558,6 @@ parse_user_options(){
shift
USE_PSK=1
;;
--daemon)
shift
DAEMONIZE=1
@ -557,7 +580,6 @@ parse_user_options(){
shift
KEEP_CONFDIR=1
;;
*)
echo "Invalid parameter: $1" 1>&2
exit 1
@ -778,7 +800,7 @@ show_interface_pci_info() { # pci id / model / virtual
[[ -n "$driver" ]] && echo "System-already-loaded driver: $driver"
[[ -n "$device_fullname" ]] && echo "$device_fullname"
echo ""
# TODO usb
# TODO Fix pci and usb devices
}
alloc_new_vface_name() { # only for wifi
@ -1998,6 +2020,10 @@ write_hostapd_conf() {
echo "ieee80211ac=1" >> "$CONFDIR/hostapd.conf"
fi
if [[ $IDLETIMEOUT -ne 300 ]]; then
echo "ap_max_inactivity=${IDLETIMEOUT}" >> "$CONFDIR/hostapd.conf"
fi
if [[ $REQUIREVHT -eq 1 ]]; then
echo "require_vht=1" >> "$CONFDIR/hostapd.conf"
fi
@ -2010,7 +2036,21 @@ write_hostapd_conf() {
echo "require_he=1" >> "$CONFDIR/hostapd.conf"
fi
if [[ $HESUBFE -eq 1 ]]; then
echo "he_su_beamformee=1" >> "$CONFDIR/hostapd.conf"
fi
if [[ $HESUBFR -eq 1 ]]; then
echo "he_su_beamformer=1" >> "$CONFDIR/hostapd.conf"
fi
if [[ $HEMUBFR -eq 1 ]]; then
echo "he_mu_beamformer=1" >> "$CONFDIR/hostapd.conf"
fi
if [[ $HEP2PTWT -eq 1 ]]; then
echo "peer_to_peer_twt=1" >> "$CONFDIR/hostapd.conf"
fi
if [[ -n "$VHT_CAPAB" ]]; then
echo "vht_capab=${VHT_CAPAB}" >> "$CONFDIR/hostapd.conf"