Skip to content

Instantly share code, notes, and snippets.

@jpetazzo
Created November 2, 2015 22:21
Show Gist options
  • Save jpetazzo/54695d772bf261b6ccf0 to your computer and use it in GitHub Desktop.
Save jpetazzo/54695d772bf261b6ccf0 to your computer and use it in GitHub Desktop.
#!/bin/sh
SSID=$1
PSK=$2
nmcli con add con-name "w-$SSID" ifname wlan0 type wifi ssid "$SSID"
nmcli con mod "w-$SSID" wifi-sec.key-mgmt wpa-psk
nmcli con mod "w-$SSID" wifi-sec.psk "$2"
nmcli con up "w-$SSID"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment