1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-12-22 14:58:08 +00:00

piholeDebug: Fix version check if lighttpd/php are not installed

Signed-off-by: Reto Gantenbein <reto.gantenbein@linuxmonk.ch>
This commit is contained in:
Reto Gantenbein 2020-12-05 13:40:44 +01:00
parent 6deac6dfce
commit 18e4eb460c

View File

@ -371,9 +371,9 @@ get_program_version() {
echo_current_diagnostic "${program_name} version" echo_current_diagnostic "${program_name} version"
# Evalutate the program we are checking, if it is any of the ones below, show the version # Evalutate the program we are checking, if it is any of the ones below, show the version
case "${program_name}" in 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 # If a match is not found, show an error
*) echo "Unrecognized program"; *) echo "Unrecognized program";