summaryrefslogtreecommitdiffstats
path: root/src/connections
diff options
context:
space:
mode:
authorJames Rayner <james@archlinux.org>2009-09-23 15:55:04 +0200
committerJames Rayner <james@archlinux.org>2009-09-23 15:55:04 +0200
commit4d80e053525f937b3eb76d9d2072895a826f53d6 (patch)
tree78351a487ca7d1411d3bfecc707dc344e7244bff /src/connections
parent0bba84008f180097acf979cc2e87533c6e0bf2bd (diff)
downloadnetctl-4d80e053525f937b3eb76d9d2072895a826f53d6.tar.gz
netctl-4d80e053525f937b3eb76d9d2072895a826f53d6.tar.xz
Add WPA_DRIVER, WPA_COUNTRY and handle WEP string keys
WPA_DRVER: Configure the -D argument to wpa_supplicant, for example -Dnl80211 WPA_COUNTRY: Set the 'country=' variable in the wpa_supplicant configuration. WEP string keys: modified such that they may work. Not tested yet.
Diffstat (limited to 'src/connections')
-rw-r--r--src/connections/ethernet6
-rw-r--r--src/connections/wireless16
2 files changed, 13 insertions, 9 deletions
diff --git a/src/connections/ethernet b/src/connections/ethernet
index 1775247..20ee545 100644
--- a/src/connections/ethernet
+++ b/src/connections/ethernet
@@ -31,10 +31,10 @@ ethernet_up() {
if checkyesno "${AUTH8021X:-no}"; then
. "$SUBR_DIR/8021x"
[[ -z "$WPA_CONF" ]] && WPA_CONF="/etc/wpa_supplicant.conf"
- [[ -z "$WPA_OPTS" ]] && WPA_OPTS="-Dwired"
+ [[ -z "$WPA_DRIVER" ]] && WPA_DRIVER="wired"
- report_debug ethernet_iproute_up start_wpa "$INTERFACE" "$WPA_CONF" "$WPA_OPTS"
- if ! start_wpa "$INTERFACE" "$WPA_CONF" "$WPA_OPTS"; then
+ report_debug ethernet_iproute_up start_wpa "$INTERFACE" "$WPA_CONF" "$WPA_DRIVER" "$WPA_OPTS"
+ if ! start_wpa "$INTERFACE" "$WPA_CONF" "$WPA_DRIVER" "$WPA_OPTS"; then
report_fail "wpa_supplicant did not start, possible configuration error"
return 1
fi
diff --git a/src/connections/wireless b/src/connections/wireless
index 6e99952..413c5db 100644
--- a/src/connections/wireless
+++ b/src/connections/wireless
@@ -115,7 +115,11 @@ wireless_up() {
;;
wep)
WPA_CONF="$(make_wpa_config $1)"
- echo -e "network={ \nssid=\"$ESSID\" \nkey_mgmt=NONE \nwep_key0=\"$KEY\" \nwep_tx_keyidx=0 \n}" >> "$WPA_CONF"
+ if [[ ${KEY:0:2} == "s:" ]]; then # TODO: does wpa_supplicant handle this as expected?
+ echo -e "network={ \nssid=\"$ESSID\" \nkey_mgmt=NONE \nwep_key0=\"${KEY:2}\" \nwep_tx_keyidx=0 \n}" >> "$WPA_CONF"
+ else
+ echo -e "network={ \nssid=\"$ESSID\" \nkey_mgmt=NONE \nwep_key0=$KEY \nwep_tx_keyidx=0 \n}" >> "$WPA_CONF"
+ fi
;;
none)
WPA_CONF="$(make_wpa_config $1)"
@@ -151,15 +155,15 @@ wireless_up() {
;;
wpa-configsection)
. "$SUBR_DIR/8021x"
- WPA_CONF="$(make_wpa_config $1)"
- echo -e "$CONFIGSECTION" >> "$WPA_CONF"
+ WPA_CONF="$(make_wpa_config $1)"
+ echo -e "network={ \n$CONFIGSECTION \n}">> "$WPA_CONF"
;;
esac
if [[ ${SECURITY:(-4)} != "-old" ]]; then
- [[ -z "$WPA_OPTS" ]] && WPA_OPTS="-Dwext"
- report_debug wireless_up start_wpa "$INTERFACE" "$WPA_CONF" "$WPA_OPTS"
- if ! start_wpa "$INTERFACE" "$WPA_CONF" "$WPA_OPTS"; then
+ [[ -z "$WPA_DRIVER" ]] && WPA_DRIVER="wext"
+ report_debug wireless_up start_wpa "$INTERFACE" "$WPA_CONF" "$WPA_DRIVER" "$WPA_OPTS"
+ if ! start_wpa "$INTERFACE" "$WPA_CONF" "$WPA_DRIVER" "$WPA_OPTS"; then
report_fail "wpa_supplicant did not start, possible configuration error"
return 1
fi