Skip to content

Instantly share code, notes, and snippets.

@pachacamac
Last active February 15, 2016 06:33
Show Gist options
  • Save pachacamac/77680620d38c0c1fe1f8 to your computer and use it in GitHub Desktop.
Save pachacamac/77680620d38c0c1fe1f8 to your computer and use it in GitHub Desktop.
Workaround for the Ubuntu (NetworkManager?) problem of not being able to connect to a new WiFi network. Or maybe you just prefer to do things conveniently from the CLI.
#/bin/bash
echo "WiFi Networks in range:"
nmcli device wifi list
echo "-----------------------"
echo -n "To which SSID do you want to connect? "
read ssid
echo -n "What is the password for '$ssid'? "
read pass
sudo nmcli dev wifi con "$ssid" password "$pass" name "$ssid"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment