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