5

Is there any way to enable a pre-configured Wi-Fi hotspot from a shell script/command line without going to Settings > Wi-Fi > (settings icon) > Turn On Wi-Fi Hotspot... > Turn On?

  • https://askubuntu.com/q/1146694/739431 – PRATAP Aug 10 '19 at 03:26
  • This answer has a script which does something very similar: It creates the AP interface and shows how to bring it up and down. Bringing an existing interface up and down should be as easy as ip link set INTERFACE up/down. – dessert Aug 10 '19 at 10:06

1 Answers1

6

Based on @PRATAP's answer:

nmcli connection up <SSID>

Where <SSID> is likely Hotspot (can check this by running nm-connection-editor or going to Settings > Wi-Fi > (settings icon) > Connect to Hidden Wi-Fi Network... > Connection).

nmcli connection up/down also works for normal (non-hotspot) networks.