From be0efa233293f82e524a918dafdbeefa69477b4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Tue, 24 Jan 2023 22:19:24 +0100 Subject: [PATCH] Add lighttpd selftest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- advanced/Scripts/piholeDebug.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 614e00b1..aa197512 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -981,6 +981,20 @@ ftl_full_status(){ fi } +lighttpd_test_configuration(){ + # let lighttpd test it's own configuration + local lighttpd_conf_test + echo_current_diagnostic "Lighttpd configuration test" + lighttpd_conf_test=$(lighttpd -tt -f /etc/lighttpd/lighttpd.conf) + if [ -z "${lighttpd_conf_test}" ]; then + # empty output + log_write "${TICK} ${COL_GREEN}No error in lighttpd configuration${COL_NC}" + else + log_write "${CROSS} ${COL_RED}Error in lighttpd configuration${COL_NC}" + log_write " ${lighttpd_conf_test}" + fi +} + make_array_from_file() { local filename="${1}" # The second argument can put a limit on how many line should be read from the file @@ -1506,6 +1520,7 @@ check_name_resolution check_dhcp_servers process_status ftl_full_status +lighttpd_test_configuration parse_setup_vars check_x_headers analyze_ftl_db