1
0
mirror of https://github.com/pi-hole/pi-hole synced 2025-02-11 15:42:38 +00:00

Use temp variable for curl -V output

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER 2025-01-29 19:19:01 +01:00
parent 6e0b16ed1a
commit f50c696253
No known key found for this signature in database
GPG Key ID: 00135ACBD90B28DD

View File

@ -414,7 +414,7 @@ gravity_DownloadBlocklists() {
echo -e " ${INFO} Storing gravity database in ${COL_BOLD}${gravityDBfile}${COL_NC}"
fi
local url domain str target compression adlist_type directory
local url domain str target compression adlist_type directory curlVersion
echo ""
# Prepare new gravity database
@ -496,7 +496,8 @@ gravity_DownloadBlocklists() {
# Use compression to reduce the amount of data that is transferred
# between the Pi-hole and the ad list provider. Use this feature
# only if it is supported by the locally available version of curl
if curl -V | grep -q "Features:.* libz"; then
curlVersion=$(curl -V)
if echo "${curlVersion}" | grep -q "Features:.* libz"; then
compression="--compressed"
echo -e " ${INFO} Using libz compression\n"
else
@ -508,11 +509,11 @@ gravity_DownloadBlocklists() {
# comparing the version string being >= 7.68.0 (released Jan 2020)
# https://github.com/curl/curl/pull/4543 followed by
# https://github.com/curl/curl/pull/4678
if curl -V | grep -q "curl 7\.[6-9][8-9]"; then
if echo "${curlVersion}" | grep -q "curl 7\.[6-9][8-9]"; then
etag_support=true
else
# Check if the version is >= 8
if curl -V | grep -q "curl 8"; then
if echo "${curlVersion}" | grep -q "curl 8"; then
etag_support=true
fi
fi