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 bf0c5fc..737bd1a 100644 (file)
@@ -378,6 +378,9 @@ hostapd_config_write() {
                ) >> ${file}
        fi
 
+       # Log configuration file
+       file_to_log DEBUG "${file}"
+
        return ${EXIT_OK}
 }
 
index b767423..4c1dbb4 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}"