* Backport ee7090b8fc to v4 to prevent failures in FTL download
* update tests to reflect changes to FTL download URL
* backport `tbd` fix
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
#In the next section we check to see if FTL is already installed (in case of pihole -r).
#In the next section we check to see if FTL is already installed (in case of pihole -r).
#If the installed version matches the latest version, then check the installed sha1sum of the binary vs the remote sha1sum. If they do not match, then download
#If the installed version matches the latest version, then check the installed sha1sum of the binary vs the remote sha1sum. If they do not match, then download
printf" %b Checking for existing FTL binary...\\n""${INFO}"
printf" %b Checking for existing FTL binary...\\n""${INFO}"
@ -2342,6 +2338,9 @@ FTLcheckUpdate() {
ftlBranch="master"
ftlBranch="master"
fi
fi
local binary
binary="${1}"
local remoteSha1
local remoteSha1
local localSha1
local localSha1
@ -2420,8 +2419,10 @@ FTLcheckUpdate() {
FTLdetect(){
FTLdetect(){
printf"\\n %b FTL Checks...\\n\\n""${INFO}"
printf"\\n %b FTL Checks...\\n\\n""${INFO}"
if FTLcheckUpdate ;then
printf" %b""${2}"
FTLinstall ||return1
if FTLcheckUpdate "${1}";then
FTLinstall "${1}"||return1
fi
fi
}
}
@ -2581,8 +2582,17 @@ main() {
else
else
LIGHTTPD_ENABLED=false
LIGHTTPD_ENABLED=false
fi
fi
# Create the pihole user
create_pihole_user
# Check if FTL is installed - do this early on as FTL is a hard dependency for Pi-hole
# Check if FTL is installed - do this early on as FTL is a hard dependency for Pi-hole
if ! FTLdetect;then
local funcOutput
funcOutput=$(get_binary_name)#Store output of get_binary_name here
local binary
binary="pihole-FTL${funcOutput##*pihole-FTL}"#binary name will be the last line of the output of get_binary_name (it always begins with pihole-FTL)
local theRest
theRest="${funcOutput%pihole-FTL*}"# Print the rest of get_binary_name's output to display (cut out from first instance of "pihole-FTL")