From 40fb3202906ecc39d478702a42c78726389e0ad2 Mon Sep 17 00:00:00 2001 From: Tim Wilkinson Date: Tue, 7 Jun 2022 21:31:51 -0700 Subject: [PATCH] Fix 5GHz AP bad channel dropdown --- files/www/cgi-bin/setup | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/files/www/cgi-bin/setup b/files/www/cgi-bin/setup index ec2cc700..a4ee1985 100755 --- a/files/www/cgi-bin/setup +++ b/files/www/cgi-bin/setup @@ -1196,14 +1196,13 @@ end html.print("
") --- $M39model = `/usr/local/bin/get_model | grep -e "M[39]"`; -local M39model +local M39model = aredn.hardware.get_board_id():match("M[39]") if (phycount > 1 and (wifi_enable ~= "1" or wifi3_enable ~= "1")) or (phycount == 1 and wifi_enable ~= "1" and wifi3_enable ~= "1") and not M39model then -- lan ap shows as an option -- determine hardware options and set band ahd channels accordingly if phycount == 1 then - -- rc3 = -- system("iw phy phy0 info | grep -q '5180 MHz' > /dev/null"); - if rc3 ~= "" then + local rc3 = os.execute("iw phy phy0 info | grep -q '5180 MHz' > /dev/null") + if rc3 ~= 0 then wifi2_hwmode = "11g" if wifi2_channel > 14 then wifi2_channel = 1 @@ -1313,9 +1312,8 @@ if (phycount > 1 and (wifi_enable ~= "1" or wifi2_enable ~= "1")) or (phycount = -- determine hardware options and set band accordingly if phycount == 1 then - -- $rc3 = system("iw phy phy0 info | grep -q '5180 MHz' > /dev/null"); - local rc3 - if rc3 ~= "" then + local rc3 = os.execute("iw phy phy0 info | grep -q '5180 MHz' > /dev/null") + if rc3 ~= 0 then wifi3_hwmode = "11g" else wifi3_hwmode = "11a"