Revert "Add force channel flag"

This reverts commit 73441c4ed3.
This commit is contained in:
garywill 2023-10-04 10:41:13 +08:00
parent 9d874dbe88
commit 992ad00ca1
1 changed files with 1 additions and 7 deletions

View File

@ -89,7 +89,6 @@ Options:
for both Internet and AP
--virt-name <name> Set name of virtual interface
-c <channel> Channel number (default: 1)
--force_channel Force the use of channel provided by -c flag
--country <code> Set two-letter country code for regularity
(example: US)
--freq-band <GHz> Set frequency band: 2.4 or 5 (default: 2.4)
@ -196,7 +195,6 @@ define_global_variables(){
HIDDEN=0 # hidden wifi hotspot
WIFI_IFACE=
CHANNEL=default
FORCECHANNEL=0 # Forces channel provided by -c flag
HOTSPOT20=0 # For enabling Hotspot 2.0
WPA_VERSION=2
MAC_FILTER=0
@ -397,10 +395,6 @@ parse_user_options(){
CHANNEL="$1"
shift
;;
--force_channel)
shift
FORCECHANNEL=1
;;
--hs20)
shift
HOTSPOT20=1
@ -1703,7 +1697,7 @@ prepare_wifi_interface() {
if [[ $NO_VIRT -eq 0 ]]; then
## Will generate virtual wifi interface
if is_interface_wifi_connected ${WIFI_IFACE} && [[ FORCECHANNEL -eq 0 ]]; then
if is_interface_wifi_connected ${WIFI_IFACE}; then
WIFI_IFACE_FREQ=$(iw dev ${WIFI_IFACE} link | grep -i freq | awk '{print $2}')
WIFI_IFACE_CHANNEL=$(ieee80211_frequency_to_channel ${WIFI_IFACE_FREQ})
echo "${WIFI_IFACE} already in channel ${WIFI_IFACE_CHANNEL} (${WIFI_IFACE_FREQ} MHz)"