Merge pull request #2115 from bergware/master

Wireless fixes
This commit is contained in:
tom mortensen
2025-04-04 09:36:06 -07:00
committed by GitHub
2 changed files with 4 additions and 3 deletions

View File

@@ -48,7 +48,7 @@ function scanWifi($port) {
// store MAC address only
$wlan[$network][0] = substr($wlan[$network][0],4,17);
// identify open network
$wlan[$network][4] = $wlan[$network][4] ?: 'open';
$wlan[$network][4] = $wlan[$network][4] ?? 'open';
} else {
// group radio frequencies
$wlan[$network][1] .= ' '.$attr[1];
@@ -84,7 +84,7 @@ case 'list':
$title = _('Connect to WiFi network');
$port = array_key_first($wifi);
$carrier = "/sys/class/net/$port/carrier";
$echo = [];
$echo = $wlan = [];
foreach ($wifi as $network => $block) {
if ($network == $port) continue;
$wlan[$network][0] = $block['ATTR1'] ?? '';
@@ -185,8 +185,8 @@ case 'join':
}
if ($manual || $safe) {
echo "<tr><td>"._('Security')."</td><td><select name=\"SECURITY\" onclick=\"showSecurity(this.value)\">";
echo mk_option($safe, 'open', _('None'));
echo mk_option($safe, 'auto', _('Automatic'));
echo mk_option($safe, 'open', _('None'));
echo mk_option($safe, 'PSK', _('WPA2'));
echo mk_option($safe, 'PSK SAE', _('WPA2/WPA3'));
echo mk_option($safe, 'SAE', _('WPA3'));

View File

@@ -147,6 +147,7 @@ wpa_configuration(){
[[ -z $2 && -n $CC ]] && echo "country=${CC,,}" >>$WPA
echo "network={" >>$WPA
echo "ssid=\"$SSID\"" >>$WPA
echo "scan_ssid=1" >>$WPA
[[ $1 == "PSK" ]] && echo "key_mgmt=WPA-PSK" >>$WPA
[[ $1 == "SAE" ]] && echo "key_mgmt=SAE" >>$WPA
[[ $1 =~ "IEEE" && $1 != "IEEE 802.1X/SHA-256" ]] && echo "key_mgmt=WPA-EAP" >>$WPA