]> git.ipfire.org Git - people/stevee/network.git/commitdiff
wpa_supplicant: Move configuration to /etc/wpa_supplicant
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 18 Aug 2017 09:09:49 +0000 (09:09 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 18 Aug 2017 09:09:49 +0000 (09:09 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/functions/functions.constants
src/functions/functions.wpa_supplicant
src/helpers/wpa_supplicant

index 5467801e5f1696d2a51f87c9eca2f1a9150ff559..78801da0f381869f1eb65f3f859d98ef61b9393f 100644 (file)
@@ -45,6 +45,9 @@ NETWORK_IPSEC_POOLS_DIR="${NETWORK_CONFIG_DIR}/vpn/ipsec/pools"
 NETWORK_IPSEC_SWANCTL_CONNECTIONS_DIR="/etc/swanctl/connections"
 NETWORK_IPSEC_SWANCTL_POOLS_DIR="/etc/swanctl/pools"
 
+# WPA supplicant
+WPA_SUPPLICANT_CONF_DIR="/etc/wpa_supplicant"
+
 # Network file configuration.
 NETWORK_SETTINGS_FILE=${NETWORK_CONFIG_DIR}/config
 NETWORK_SETTINGS_FILE_PARAMS="DEBUG"
index b64bf2e2768995480d5b9d0acaec922af4117e3c..cc754cf8d310c1e871602850698719c6a73c30ea 100644 (file)
@@ -27,7 +27,7 @@ wpa_supplicant_config_write() {
 
        assert isset device
 
-       local file="$(wpa_supplicant_config_dir "${device}")/wpa_supplicant.conf"
+       local file="${WPA_SUPPLICANT_CONF_DIR}/${device}.conf"
 
        local ap_scan=1 mode key ssid
        local channel
@@ -142,8 +142,8 @@ wpa_supplicant_config_write() {
                        ;;
        esac
 
-       local config_dir=$(dirname ${file})
-       mkdir -p ${config_dir} 2>/dev/null
+       # Ensure we can write the file
+       make_parent_dir "${file}"
 
        config_header "WPA supplicant configuration file" > ${file}
 
@@ -215,16 +215,7 @@ wpa_supplicant_config_destroy() {
        local device="${1}"
        assert isset device
 
-       local file="$(wpa_supplicant_config_dir "${device}")/wpa_supplicant.conf"
-
-       file_delete "${file}"
-}
-
-wpa_supplicant_config_dir() {
-       local device=${1}
-       assert isset device
-
-       echo "${RUN_DIR}/wpa_supplicant/${device}"
+       file_delete "${WPA_SUPPLICANT_CONF_DIR}/${device}.conf"
 }
 
 wpa_supplicant_start() {
index 69ee0ee506f2ff8f01fd077da696a561a7232653..5ec227c1f40a8bb62820f74daa5583ef888ac26c 100644 (file)
@@ -30,9 +30,7 @@ assert isset device
 # Create socket dir.
 mkdir -p ${WPA_SUPPLICANT_SOCKET_DIR} 2>/dev/null
 
-config_file="$(wpa_supplicant_config_dir ${device})/wpa_supplicant.conf"
-
-cmd="wpa_supplicant -i ${device} -c ${config_file}"
+cmd="wpa_supplicant -i ${device} -c ${WPA_SUPPLICANT_CONF_DIR}/${device}.conf"
 
 if device_is_wireless ${device}; then
        cmd="${cmd} -Dwext"