Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
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
+ # Write a config header
+ wpa_supplicant_config_header
wireless_networks_to_wpa_supplicant
) > ${file}
WPA_SUPPLICANT_SOCKET_DIR="${RUN_DIR}/wpa_supplicant/ctrl"
+wpa_supplicant_config_header() {
+ 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}"
+ fi
+
+ print # end of header
+}
+
wpa_supplicant_config_write() {
local device="${1}"
shift