From ecd59e537e7ca3957e9a255861df1c46019ea02a Mon Sep 17 00:00:00 2001 From: PaulVua Date: Tue, 17 Mar 2026 18:05:40 +0100 Subject: [PATCH] forget_wifi: scan WiFi avant hotspot pour remplir wifi_list.csv Sans ce scan, le CSV est vide/perime et la page WiFi en hotspot ne peut pas afficher les reseaux disponibles. Co-Authored-By: Claude Opus 4.6 (1M context) --- forget_wifi.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/forget_wifi.sh b/forget_wifi.sh index e645c84..463aa33 100644 --- a/forget_wifi.sh +++ b/forget_wifi.sh @@ -33,6 +33,12 @@ fi sleep 1 +# Scan WiFi networks BEFORE starting hotspot (scan impossible once hotspot is active) +OUTPUT_FILE="/var/www/nebuleair_pro_4g/wifi_list.csv" +echo "Scanning WiFi networks..." +nmcli -f SSID,SIGNAL,SECURITY device wifi list | awk 'BEGIN { OFS=","; print "SSID,SIGNAL,SECURITY" } NR>1 { print $1,$2,$3 }' > "$OUTPUT_FILE" +echo "WiFi scan saved to $OUTPUT_FILE" + # Start hotspot echo "Starting hotspot with SSID: $DEVICE_NAME" sudo nmcli device wifi hotspot ifname wlan0 ssid "$DEVICE_NAME" password nebuleaircfg