fix: make setup script WiFi-safe by removing instant network activation
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user