From 49ee0751d062fc27c8e81c1b02df50fa2e231be6 Mon Sep 17 00:00:00 2001 From: billz Date: Mon, 17 Nov 2025 09:55:54 +0100 Subject: [PATCH] Reload .ini after save, fix LogEnable condition --- includes/hostapd.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/includes/hostapd.php b/includes/hostapd.php index a074709d..58b2d9fc 100755 --- a/includes/hostapd.php +++ b/includes/hostapd.php @@ -45,8 +45,10 @@ function DisplayHostAPDConfig() } else { $interface = $_SESSION['ap_interface']; } + $txpower = $hotspot->getTxPower($interface); $arrHostapdConf = $hotspot->getHostapdIni(); + $logOutput = []; if (!RASPI_MONITOR_ENABLED) { if (isset($_POST['StartHotspot']) || isset($_POST['RestartHotspot'])) { @@ -77,6 +79,10 @@ function DisplayHostAPDConfig() $reg_domain, $status ); + + // reload hostapi.ini + $arrHostapdConf = $hotspot->getHostapdIni(); + } elseif (isset($_POST['StopHotspot'])) { $status->addMessage('Attempting to stop hotspot', 'info'); exec('sudo /bin/systemctl stop hostapd.service', $return); @@ -136,8 +142,7 @@ function DisplayHostAPDConfig() } // fetch hostapd logs if enabled - $logOutput = []; - if (!empty($arrHostapdConf['LogEnable']) && (int)$arrHostapdConf['LogEnable'] === 1) { + if ((string)$arrHostapdConf['LogEnable'] === "1") { $logResult = $hotspot->getHostapdLogs(5000); if ($logResult['success']) { $joined = implode("\n", $logResult['logs']);