Revise fetch hostapd logs w/ hotspot->getHostapdLogs()

This commit is contained in:
billz
2025-11-16 21:32:09 +01:00
parent de188cd8fc
commit e5c162ddcf

View File

@@ -135,15 +135,22 @@ function DisplayHostAPDConfig()
}
}
// fetch hostapd logs if enabled
$logOutput = [];
if (!empty($arrHostapdConf['LogEnable']) && (int)$arrHostapdConf['LogEnable'] === 1) {
$logResult = $hotspot->getHostapdLogs(5000);
if ($logResult['success']) {
$joined = implode("\n", $logResult['logs']);
$limited = getLogLimited('', $joined);
$logOutput = explode("\n", $limited);
}
}
// assign disassoc_low_ack boolean if value is set
$arrConfig['disassoc_low_ack_bool'] = isset($arrConfig['disassoc_low_ack']) ? 1 : 0;
$hostapdstatus = $system->hostapdStatus();
$serviceStatus = $hostapdstatus[0] == 0 ? "down" : "up";
// ensure log is writeable
exec('sudo /bin/chmod o+r '.RASPI_HOSTAPD_LOG);
$logdata = getLogLimited(RASPI_HOSTAPD_LOG);
echo renderTemplate(
"hostapd", compact(
"status",
@@ -161,7 +168,7 @@ function DisplayHostAPDConfig()
"arrHostapdConf",
"operatingSystem",
"countryCodes",
"logdata"
"logOutput"
)
);
}