From 408ab767e17b70c7d5ce1aa2e31bde938adffa40 Mon Sep 17 00:00:00 2001 From: PaulVua Date: Tue, 17 Mar 2026 18:15:02 +0100 Subject: [PATCH] Revert: retrait nmcli de get_config_sqlite (cause lenteur pages) L'appel nmcli dans get_config_sqlite bloquait les workers Apache. Le statut WiFi est maintenant gere uniquement par les scripts shell (connexion.sh, forget_wifi.sh, boot_hotspot.sh). Co-Authored-By: Claude Opus 4.6 (1M context) --- html/launcher.php | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/html/launcher.php b/html/launcher.php index 36da695..5c036a9 100755 --- a/html/launcher.php +++ b/html/launcher.php @@ -66,22 +66,6 @@ if ($type == "get_config_sqlite") { $result[$key] = $parsed_value; } - // Detect real WiFi status from wlan0 (DB value may be stale) - // Use timeout to prevent blocking if nmcli hangs - $wlan0_conn = trim(shell_exec("timeout 2 nmcli -t -f GENERAL.CONNECTION device show wlan0 2>/dev/null | cut -d: -f2")); - if ($wlan0_conn !== null && $wlan0_conn !== '' && $wlan0_conn !== '--') { - $is_hotspot = (stripos($wlan0_conn, 'hotspot') !== false); - $real_status = $is_hotspot ? 'hotspot' : 'connected'; - - // Update DB if out of sync - if (isset($result['WIFI_status']) && $result['WIFI_status'] !== $real_status) { - $update_stmt = $db->prepare("UPDATE config_table SET value = ? WHERE key = 'WIFI_status'"); - $update_stmt->execute([$real_status]); - } - $result['WIFI_status'] = $real_status; - } - // If timeout or nmcli fails, keep DB value as-is - // Return JSON response header('Content-Type: application/json'); echo json_encode($result, JSON_PRETTY_PRINT);