Fix wireless at boot: don't start when not enabled

This commit is contained in:
bergware
2025-02-15 19:51:55 +01:00
parent e16fb7ba37
commit 642e221556

View File

@@ -28,10 +28,10 @@ if ($arg == 'yes') {
} elseif ($arg == 'no') {
exec("/etc/rc.d/rc.wireless stop");
exec("$docroot/webGui/scripts/update_services 5");
} else {
} elseif (($wifi['wlan0']['WIFI']??'') == 'yes') {
foreach ($wifi as $network => $block) {
if ($network == $port) continue;
if ($block['GROUP'] == $state && (!$arg || $arg == $network)) {
if (($block['GROUP']??'') == $state && (!$arg || $arg == $network)) {
$text[] = "SSID=\"$network\"";
unset($block['GROUP']);
foreach ($block as $key => $value) $text[] = "$key=\"$value\"";