diff --git a/scripts/setup.sh b/scripts/setup.sh index 29bba51..a5ec692 100644 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -141,14 +141,11 @@ echo "Configuring Networking..." rfkill unblock wlan || true if command -v nmcli > /dev/null; then - echo "NetworkManager detected. Using nmcli for hotspot..." - # Disconnect current wifi to free the radio - nmcli device disconnect wlan0 2>/dev/null || true - + echo "NetworkManager detected. Configuring hotspot (WiFi-Safe)..." # Clean up any existing MPVJ connection nmcli con delete MPVJ-AP 2>/dev/null || true - # Create the Access Point + # Create the Access Point profile (but don't activate it yet) nmcli con add type wifi ifname wlan0 mode ap con-name MPVJ-AP autoconnect yes ssid "$WIFI_SSID" nmcli con modify MPVJ-AP 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared nmcli con modify MPVJ-AP wifi-sec.key-mgmt wpa-psk @@ -156,9 +153,6 @@ if command -v nmcli > /dev/null; then nmcli con modify MPVJ-AP ipv4.addresses 192.168.4.1/24 nmcli con modify MPVJ-AP connection.autoconnect-priority 100 - # Bring it up immediately - nmcli con up MPVJ-AP || true - # Ensure hostapd/dnsmasq are disabled systemctl stop hostapd dnsmasq 2>/dev/null || true systemctl disable hostapd dnsmasq 2>/dev/null || true