25 lines
536 B
Bash
Executable File
25 lines
536 B
Bash
Executable File
#!/bin/bash
|
|
|
|
read -rp "Wireless interface: " IFACE
|
|
|
|
# Remove an existing profile with the same name (optional)
|
|
nmcli connection delete pihotspot 2>/dev/null
|
|
|
|
# Create the access point
|
|
nmcli connection add \
|
|
type wifi \
|
|
ifname "$IFACE" \
|
|
con-name pihotspot \
|
|
ssid pihotspot
|
|
|
|
# Configure it
|
|
nmcli connection modify pihotspot \
|
|
802-11-wireless.mode ap \
|
|
ipv4.method manual \
|
|
ipv4.addresses "192.168.38.1/24" \
|
|
ipv6.method ignore \
|
|
connection.autoconnect yes
|
|
|
|
# Bring it up
|
|
nmcli connection up pihotspot
|