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:
@@ -18,6 +18,10 @@ fi
|
|||||||
|
|
||||||
echo "Forgetting WiFi connection: $ACTIVE_WIFI"
|
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
|
# Delete (forget) the saved connection
|
||||||
sudo nmcli connection delete "$ACTIVE_WIFI"
|
sudo nmcli connection delete "$ACTIVE_WIFI"
|
||||||
|
|
||||||
@@ -27,7 +31,7 @@ else
|
|||||||
echo "Failed to delete connection '$ACTIVE_WIFI'"
|
echo "Failed to delete connection '$ACTIVE_WIFI'"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sleep 2
|
sleep 1
|
||||||
|
|
||||||
# Start hotspot
|
# Start hotspot
|
||||||
echo "Starting hotspot with SSID: $DEVICE_NAME"
|
echo "Starting hotspot with SSID: $DEVICE_NAME"
|
||||||
|
|||||||
@@ -1172,7 +1172,7 @@ if ($type == "wifi_forget") {
|
|||||||
// Launch forget script in background
|
// Launch forget script in background
|
||||||
$script_path = '/var/www/nebuleair_pro_4g/forget_wifi.sh';
|
$script_path = '/var/www/nebuleair_pro_4g/forget_wifi.sh';
|
||||||
$log_file = '/var/www/nebuleair_pro_4g/logs/app.log';
|
$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');
|
header('Content-Type: application/json');
|
||||||
echo json_encode([
|
echo json_encode([
|
||||||
|
|||||||
Reference in New Issue
Block a user