Skip to content

Instantly share code, notes, and snippets.

@KsaRedFx
Created May 3, 2014 22:43
Show Gist options
  • Save KsaRedFx/2d92b7956dd5c23fc6e2 to your computer and use it in GitHub Desktop.
Save KsaRedFx/2d92b7956dd5c23fc6e2 to your computer and use it in GitHub Desktop.
Enabling Wireless from CLI
#!/bin/bash
iface=wlan0
ifconfig -a
echo "Read the above text and input the name of the device you think is your wireless card (usually wlan0) "
read iface
ifconfig $iface down
ifconfig $iface up
iwlist $iface scan | grep -i ESSID
echo "Read the above text and input the name of the network you wish to connect to"
read router
echo "Please input the password for the network selected"
read passphrase
killall wpa_supplicant
wpa_passphrase $router $passphrase > /etc/wireless-wpa.conf
wpa_supplicant -B -Dwext -i$iface -c/etc/wireless-wpa.conf
dhclient -r
dhclient $iface
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment