From d30a5f1b950a5a1b8efcf93ccc4f80bf90e1e706 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Thu, 19 Jan 2023 12:24:57 +0000 Subject: [PATCH] Get the lighttpd version from `dpkg-query` instead Signed-off-by: Adam Warner --- automated install/basic-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 44b4b313..20fd997d 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1434,14 +1434,14 @@ installConfigs() { install -D -m 644 -T ${PI_HOLE_LOCAL_REPO}/advanced/pihole-admin.conf $conf # Get the version number of lighttpd - version=$(lighttpd -v | grep -o -E '[0-9]+\.[0-9]+\.[0-9]+') + version=$(dpkg-query -f='${Version}\n' --show lighttpd) # Test if that version is greater than or euqal to 1.4.56 if dpkg --compare-versions "$version" "ge" "1.4.56"; then # If it is, then we don't need to disable the modules + # (server.modules duplication is ignored in lighttpd 1.4.56+) : else # disable server.modules += ( ... ) in $conf to avoid module dups - # (server.modules duplication is ignored in lighttpd 1.4.56+) if awk '!/^server\.modules/{print}' $conf > $conf.$$ && mv $conf.$$ $conf; then : else