mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-12-26 23:26:47 +01:00
Reload .ini after save, fix LogEnable condition
This commit is contained in:
@@ -45,8 +45,10 @@ function DisplayHostAPDConfig()
|
|||||||
} else {
|
} else {
|
||||||
$interface = $_SESSION['ap_interface'];
|
$interface = $_SESSION['ap_interface'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$txpower = $hotspot->getTxPower($interface);
|
$txpower = $hotspot->getTxPower($interface);
|
||||||
$arrHostapdConf = $hotspot->getHostapdIni();
|
$arrHostapdConf = $hotspot->getHostapdIni();
|
||||||
|
$logOutput = [];
|
||||||
|
|
||||||
if (!RASPI_MONITOR_ENABLED) {
|
if (!RASPI_MONITOR_ENABLED) {
|
||||||
if (isset($_POST['StartHotspot']) || isset($_POST['RestartHotspot'])) {
|
if (isset($_POST['StartHotspot']) || isset($_POST['RestartHotspot'])) {
|
||||||
@@ -77,6 +79,10 @@ function DisplayHostAPDConfig()
|
|||||||
$reg_domain,
|
$reg_domain,
|
||||||
$status
|
$status
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// reload hostapi.ini
|
||||||
|
$arrHostapdConf = $hotspot->getHostapdIni();
|
||||||
|
|
||||||
} elseif (isset($_POST['StopHotspot'])) {
|
} elseif (isset($_POST['StopHotspot'])) {
|
||||||
$status->addMessage('Attempting to stop hotspot', 'info');
|
$status->addMessage('Attempting to stop hotspot', 'info');
|
||||||
exec('sudo /bin/systemctl stop hostapd.service', $return);
|
exec('sudo /bin/systemctl stop hostapd.service', $return);
|
||||||
@@ -136,8 +142,7 @@ function DisplayHostAPDConfig()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// fetch hostapd logs if enabled
|
// fetch hostapd logs if enabled
|
||||||
$logOutput = [];
|
if ((string)$arrHostapdConf['LogEnable'] === "1") {
|
||||||
if (!empty($arrHostapdConf['LogEnable']) && (int)$arrHostapdConf['LogEnable'] === 1) {
|
|
||||||
$logResult = $hotspot->getHostapdLogs(5000);
|
$logResult = $hotspot->getHostapdLogs(5000);
|
||||||
if ($logResult['success']) {
|
if ($logResult['success']) {
|
||||||
$joined = implode("\n", $logResult['logs']);
|
$joined = implode("\n", $logResult['logs']);
|
||||||
|
|||||||
Reference in New Issue
Block a user