mirror of
https://github.com/unraid/webgui.git
synced 2026-05-06 12:21:34 -05:00
Wireless: fix potential double entries in station list
This commit is contained in:
@@ -34,7 +34,7 @@ require_once "$docroot/webGui/include/Translations.php";
|
||||
require_once "$docroot/webGui/include/Helpers.php";
|
||||
|
||||
function scanWifi($port) {
|
||||
$wlan = [];
|
||||
$wlan = $scan = [];
|
||||
exec("iw ".escapeshellarg($port)." scan | grep -P '^BSS|signal:|SSID:|Authentication suites:'",$scan);
|
||||
$n = -1;
|
||||
for ($i=0; $i<count($scan); $i++) {
|
||||
@@ -48,7 +48,8 @@ function scanWifi($port) {
|
||||
$wlan[$n]['security'] = trim(explode(': ',$scan[$i])[1]);
|
||||
}
|
||||
}
|
||||
return array_values(array_intersect_key($wlan,array_unique(array_column($wlan,'ssid'))));
|
||||
foreach ($wlan as $key) if (!in_array($key['ssid'], array_column($scan, 'ssid'))) $scan[] = $key;
|
||||
return $scan;
|
||||
}
|
||||
|
||||
function saveWifi() {
|
||||
|
||||
Reference in New Issue
Block a user