fi
}
+wireless_networks_write_wpa_supplicant_configuration() {
+ local device="${1}"
+
+ local file="${WPA_SUPPLICANT_CONF_DIR}/${device}.conf"
+
+ # Ensure we can write the file
+ make_parent_directory "${file}"
+
+ local country="$(wireless_get_reg_domain)"
+
+ (
+ config_header "WPA supplicant configuration file"
+
+ # Set control socket directory.
+ print "ctrl_interface=${WPA_SUPPLICANT_SOCKET_DIR}"
+
+ # Honour country
+ if isset country; then
+ print "country=${country}"
+ print
+ fi
+
+ wireless_networks_to_wpa_supplicant
+ ) > ${file}
+}
+
wireless_networks_to_wpa_supplicant() {
local handle
for handle in $(wireless_network_list); do
assert isset key_mgmt
print_indent 0 "# ${SSID}"
- print_indent 0 "network = {"
+ print_indent 0 "network={"
print_indent 1 "ssid=\"${SSID}\""
+
+ # Priority
+ if isinteger PRIORITY; then
+ print_indent 1 "priority=${PRIORITY}"
+ fi
print
# Authentication