#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
printf" %b Checking for existing FTL binary...\\n""${INFO}"
@ -2380,6 +2385,9 @@ FTLcheckUpdate() {
ftlBranch="master"
fi
local binary
binary="${1}"
local remoteSha1
local localSha1
@ -2458,8 +2466,10 @@ FTLcheckUpdate() {
FTLdetect(){
printf"\\n %b FTL Checks...\\n\\n""${INFO}"
if FTLcheckUpdate ;then
FTLinstall ||return1
printf" %b""${2}"
if FTLcheckUpdate "${1}";then
FTLinstall "${1}"||return1
fi
}
@ -2622,8 +2632,15 @@ main() {
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
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")