]> git.ipfire.org Git - network.git/commitdiff
hostapd: Dump config file in debug mode
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 30 Mar 2019 10:26:38 +0000 (11:26 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 30 Mar 2019 10:26:38 +0000 (11:26 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/functions/functions.hostapd
src/functions/functions.util

index bf0c5fc9ee0c6928cea4e19588bf4517e29328f6..737bd1a1bbb4b948d790023c490d49726f65414e 100644 (file)
@@ -378,6 +378,9 @@ hostapd_config_write() {
                ) >> ${file}
        fi
 
+       # Log configuration file
+       file_to_log DEBUG "${file}"
+
        return ${EXIT_OK}
 }
 
index b7674238333e828c703d7f572450827f84405557..4c1dbb41a84db76dac9dc108743a4bb5e7e7d227 100644 (file)
@@ -248,6 +248,19 @@ file_get_age() {
        return ${EXIT_ERROR}
 }
 
+file_to_log() {
+       local level="${1}"
+       assert isset level
+
+       local file="${2}"
+       assert file_exists "${file}"
+
+       local line
+       while read line; do
+               log "${level}" "${line}"
+       done < "${file}"
+}
+
 make_directory() {
        local path="${1}"