From 7c91c167d10cbe3d390f0dc8c426eed0abf243b4 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 30 Mar 2019 11:26:38 +0100 Subject: [PATCH] hostapd: Dump config file in debug mode Signed-off-by: Michael Tremer --- src/functions/functions.hostapd | 3 +++ src/functions/functions.util | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/functions/functions.hostapd b/src/functions/functions.hostapd index bf0c5fc9..737bd1a1 100644 --- a/src/functions/functions.hostapd +++ b/src/functions/functions.hostapd @@ -378,6 +378,9 @@ hostapd_config_write() { ) >> ${file} fi + # Log configuration file + file_to_log DEBUG "${file}" + return ${EXIT_OK} } diff --git a/src/functions/functions.util b/src/functions/functions.util index b7674238..4c1dbb41 100644 --- a/src/functions/functions.util +++ b/src/functions/functions.util @@ -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}" -- 2.39.2