Fix forget WiFi: appel bash explicite + disconnect wlan0 avant delete

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
PaulVua
2026-03-17 17:34:30 +01:00
parent 6e17f39a2c
commit 8d0507852a
2 changed files with 6 additions and 2 deletions

View File

@@ -18,6 +18,10 @@ fi
echo "Forgetting WiFi connection: $ACTIVE_WIFI"
# Disconnect wlan0 first to prevent NetworkManager from auto-reconnecting
sudo nmcli device disconnect wlan0
echo "wlan0 disconnected"
# Delete (forget) the saved connection
sudo nmcli connection delete "$ACTIVE_WIFI"
@@ -27,7 +31,7 @@ else
echo "Failed to delete connection '$ACTIVE_WIFI'"
fi
sleep 2
sleep 1
# Start hotspot
echo "Starting hotspot with SSID: $DEVICE_NAME"

View File

@@ -1172,7 +1172,7 @@ if ($type == "wifi_forget") {
// Launch forget script in background
$script_path = '/var/www/nebuleair_pro_4g/forget_wifi.sh';
$log_file = '/var/www/nebuleair_pro_4g/logs/app.log';
shell_exec("$script_path >> $log_file 2>&1 &");
shell_exec("bash $script_path >> $log_file 2>&1 &");
header('Content-Type: application/json');
echo json_encode([