Skip to content

Instantly share code, notes, and snippets.

@samos123
Created July 5, 2015 07:46
Show Gist options
  • Select an option

  • Save samos123/69b9f0fde9f3148dab6c to your computer and use it in GitHub Desktop.

Select an option

Save samos123/69b9f0fde9f3148dab6c to your computer and use it in GitHub Desktop.
connect_wifi.sh
#!/bin/bash
if [ $# -ne 2 ]; then
echo "Usage: $0 \$ssid \$passphrase";
exit 1;
fi
wifi_device=wlp3s0
ssid=$1
passphrase=$2
wpa_supplicant -D nl80211,wext -i $wifi_device -c <(wpa_passphrase "$ssid" "$passphrase")
dhcpcd $wifi_device
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment