1 wpa_supplicant_setup_vif
() {
6 # wpa_supplicant should use wext for mac80211 cards
7 [ "$driver" = "mac80211" ] && driver
='wext'
9 # make sure we have the psk
11 config_get key
"$vif" key
17 config_get_bool usepassphrase
"$vif" passphrase
1
21 if [ "$usepassphrase" = "1" ]; then
22 passphrase
="psk=\"${key}\""
24 passphrase
="psk=${key}"
29 if [ "$usepassphrase" = "1" ]; then
30 passphrase
="psk=\"${key}\""
32 passphrase
="psk=${key}"
40 config_get ca_cert
"$vif" ca_cert
41 ca_cert
=${ca_cert:+"ca_cert=\"$ca_cert\""}
44 pairwise
='pairwise=CCMP'
46 config_get priv_key
"$vif" priv_key
47 config_get priv_key_pwd
"$vif" priv_key_pwd
48 priv_key
="private_key=\"$priv_key\""
49 priv_key_pwd
="private_key_passwd=\"$priv_key_pwd\""
52 config_get auth
"$vif" auth
53 config_get identity
"$vif" identity
54 config_get password
"$vif" password
55 phase2
="phase2=\"auth=${auth:-MSCHAPV2}\""
56 identity
="identity=\"$identity\""
57 password
="password=\"$password\""
60 eap_type
="eap=$(echo $eap_type | tr 'a-z' 'A-Z')"
63 config_get ifname
"$vif" ifname
64 config_get bridge
"$vif" bridge
65 config_get ssid
"$vif" ssid
66 config_get bssid
"$vif" bssid
67 bssid
=${bssid:+"bssid=$bssid"}
68 cat > /var
/run
/wpa_supplicant-
$ifname.conf
<<EOF
69 ctrl_interface=/var/run/wpa_supplicant-$ifname
88 [ -z "$proto" ] || wpa_supplicant
${bridge:+ -b $bridge} -B -P "/var/run/wifi-${ifname}.pid" -D ${driver:-wext} -i "$ifname" -c /var
/run
/wpa_supplicant-
$ifname.conf