From: Michael Tremer Date: Sat, 30 Mar 2019 10:26:38 +0000 (+0100) Subject: hostapd: Dump config file in debug mode X-Git-Url: http://git.ipfire.org/?p=people%2Fms%2Fnetwork.git;a=commitdiff_plain;h=7c91c167d10cbe3d390f0dc8c426eed0abf243b4 hostapd: Dump config file in debug mode Signed-off-by: Michael Tremer --- 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}"