1 wpa_supplicant_setup_vif
() {
5 # wpa_supplicant should use wext for mac80211 cards
6 [ "$driver" = "mac80211" ] && driver
='wext'
11 config_get_bool usepassphrase
"$vif" passphrase
1
15 if [ "$usepassphrase" = "1" ]; then
16 passphrase
="psk=\"${key}\""
18 passphrase
="psk=${key}"
23 if [ "$usepassphrase" = "1" ]; then
24 passphrase
="psk=\"${key}\""
26 passphrase
="psk=${key}"
31 WPA|wpa|WPA2|wpa2i|
8021x|
8021X
)
34 config_get ca_cert
"$vif" ca_cert
35 ca_cert
="ca_cert=\"$ca_cert\""
38 pairwise
='pairwise=CCMP'
40 config_get priv_key
"$vif" priv_key
41 config_get priv_key_pwd
"$vif" priv_key_pwd
42 priv_key
="private_key=\"$priv_key\""
43 priv_key_pwd
="private_key_passwd=\"$priv_key_pwd\""
46 config_get auth
"$vif" auth
47 config_get identity
"$vif" identity
48 config_get password
"$vif" password
49 phase2
="phase2=\"auth=${auth:-MSCHAPV2}\""
50 identity
="identity=\"$identity\""
51 password
="password=\"$password\""
54 eap_type
="eap_type=$(echo $eap_type | tr 'a-z' 'A-Z')"
57 config_get ifname
"$vif" ifname
58 config_get bridge
"$vif" bridge
59 config_get ssid
"$vif" ssid
60 cat > /var
/run
/wpa_supplicant-
$ifname.conf
<<EOF
78 [ -z "$proto" ] || wpa_supplicant
${bridge:+ -b $bridge} -B -D ${driver:-wext} -i "$ifname" -c /var
/run
/wpa_supplicant-
$ifname.conf