From 9dc539c98bdf9ff3b3746f8ddeebb67af6e0af3c Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Sat, 5 Dec 2020 15:16:45 +0100 Subject: [PATCH] piholeDebug: More detailed diagnostics if Web interface is not found Signed-off-by: Reto Gantenbein --- advanced/Scripts/piholeDebug.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index bc83d70a..16042353 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -334,7 +334,17 @@ compare_local_version_to_git_version() { return 1 fi else - : + # There is no git directory so check if the web interface was disabled + local setup_vars_web_interface + setup_vars_web_interface=$(< ${PIHOLE_SETUP_VARS_FILE} grep ^INSTALL_WEB_INTERFACE | cut -d '=' -f2) + if [[ "${pihole_component}" == "Web" ]] && [[ "${setup_vars_web_interface}" == "false" ]]; then + log_write "${INFO} ${pihole_component}: Disabled in setupVars.conf via INSTALL_WEB_INTERFACE=false" + else + # Return an error message + log_write "${COL_RED}Directory ${git_dir} doesn't exist${COL_NC}" + # and exit with a non zero code + return 1 + fi fi }