Always ensure we have the correct machine arch by storing to/reading from a file rather than depending on global variable that for some reason is not always populated...
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
no need for global variable
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
Use a file in the temporary FTL download directory
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
Local binary variable named to l_binary. Disambiguate from global binary.
Allow 'binary' to be shadowed for testing.
Use ./ftlbinary in all operations.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
Revert shadow ability on binary variable.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
Remove unused tests, binary variable can not be overridden.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
This should work here, too
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
binary name is passed through from pihole checkout
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
Add comments
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
OK, let's try it this way again
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
we might be getting somewhere.. squash after this I think!
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This is a test to see if it fixes the aarch64 test (we are definitely squashing these commits
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
fix the rest of the tests
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
Remove trailing whitespace in the files we've touched here
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}"
@ -2380,6 +2385,9 @@ FTLcheckUpdate() {
ftlBranch="master"
ftlBranch="master"
fi
fi
local binary
binary="${1}"
local remoteSha1
local remoteSha1
local localSha1
local localSha1
@ -2458,8 +2466,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
}
}
@ -2622,8 +2632,15 @@ main() {
fi
fi
# Create the pihole user
# Create the pihole user
create_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")