From: Michael Tremer Date: Sat, 19 Aug 2017 09:21:42 +0000 (+0000) Subject: wpa_supplicant: Move config header generation into own function X-Git-Tag: 010~203 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1b49125b5c7f61f051e01d0f04e6cc516411ca0;p=network.git wpa_supplicant: Move config header generation into own function Signed-off-by: Michael Tremer --- diff --git a/src/functions/functions.wireless-networks b/src/functions/functions.wireless-networks index bba894ee..b3db4859 100644 --- a/src/functions/functions.wireless-networks +++ b/src/functions/functions.wireless-networks @@ -344,16 +344,8 @@ wireless_networks_write_wpa_supplicant_configuration() { 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} diff --git a/src/functions/functions.wpa_supplicant b/src/functions/functions.wpa_supplicant index ee5b9641..bc82a40c 100644 --- a/src/functions/functions.wpa_supplicant +++ b/src/functions/functions.wpa_supplicant @@ -21,6 +21,20 @@ 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