From 18e4eb460c1cdcf396736b403bbd83ece7e8e637 Mon Sep 17 00:00:00 2001 From: Reto Gantenbein Date: Sat, 5 Dec 2020 13:40:44 +0100 Subject: [PATCH] piholeDebug: Fix version check if lighttpd/php are not installed Signed-off-by: Reto Gantenbein --- advanced/Scripts/piholeDebug.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index bc83d70a..9b923eb6 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -371,9 +371,9 @@ get_program_version() { echo_current_diagnostic "${program_name} version" # Evalutate the program we are checking, if it is any of the ones below, show the version case "${program_name}" in - "lighttpd") program_version="$(${program_name} -v |& head -n1 | cut -d '/' -f2 | cut -d ' ' -f1)" + "lighttpd") program_version="$(${program_name} -v 2> /dev/null | head -n1 | cut -d '/' -f2 | cut -d ' ' -f1)" ;; - "php") program_version="$(${program_name} -v |& head -n1 | cut -d '-' -f1 | cut -d ' ' -f2)" + "php") program_version="$(${program_name} -v 2> /dev/null | head -n1 | cut -d '-' -f1 | cut -d ' ' -f2)" ;; # If a match is not found, show an error *) echo "Unrecognized program";