wpa-supplicant 설정을 좀더 편하게 하기 위한 script를 간단히 만들어 보았다.
#!/bin/sh
function usage {
echo "Usage : wireless.sh [authentication] [ssid] [password]"
echo " - authentication : (1)wpa, (2)wep, (3)none"
echo " - ssid : AP's SSID"
echo " - password : AP's KEY"
echo " - example : wireless.sh wpa steo 1234567890"
}
function reset_dev {
echo "->Reset wifi device."
iwconfig wlan0 essid ""
killall -q udhcpc
killall -q wpa_supplicant
iwconfig wlan0 essid ""
sleep 1
}
function auth_wpa {
echo "->SSID: $1, KEY: $2"
reset_dev
wpa_passphrase "$1" "$2" > /etc/wpa_supplicant/wpa_supplicant.conf
iwconfig wlan0 essid "$1"
wpa_supplicant -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf &
udhcpc -i wlan0
}
function auth_wep {
echo "->SSID: $1, KEY: $2"
reset_dev
iwconfig wlan0 essid "$1"
iwconfig wlan0 key s:$2
iwconfig wlan0 essid "$1"
udhcpc -i wlan0
}
function auth_none {
echo "->SSID: $1"
reset_dev
iwconfig wlan0 essid "$1"
iwconfig wlan0 enc off
iwconfig wlan0 essid "$1"
udhcpc -i wlan0
}
case $1 in
"wpa")
auth_wpa $2 $3
;;
"wep")
auth_wep $2 $3
;;
"none")
auth_none $2
;;
*)
usage
;;
esac
[BCM7425] cross-compile for wireless tools (0) | 2014.02.24 |
---|---|
[BCM7425] iperf cross-compile (0) | 2014.02.24 |
[BCM7425] Ethernet Compliance Test (0) | 2014.02.21 |
[BCM7425] Atheros AR9300 802.11n PCI/PCI-E devices (ath9k) driver porting (0) | 2013.11.05 |