Fix inconsistent handling of binary variable. get_binary_variable() stores the result into a global variable we pass later on as argument to FTLinstall() and define a local variable with the same name. This is fixed by only using the globa variable in all places not. This is still not a very elegant solution but it is also not subject of the current PR.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER 2019-01-24 09:28:09 +01:00
parent 465589c0fd
commit d996e9c9ee
No known key found for this signature in database
GPG key ID: 00135ACBD90B28DD

View file

@ -115,6 +115,9 @@ else
OVER="\\r\\033[K" OVER="\\r\\033[K"
fi fi
# Define global binary variable
binary="tbd"
# A simple function that just echoes out our logo in ASCII format # A simple function that just echoes out our logo in ASCII format
# This lets users know that it is a Pi-hole, LLC product # This lets users know that it is a Pi-hole, LLC product
show_ascii_berry() { show_ascii_berry() {
@ -2130,7 +2133,6 @@ clone_or_update_repos() {
# Download FTL binary to random temp directory and install FTL binary # Download FTL binary to random temp directory and install FTL binary
FTLinstall() { FTLinstall() {
# Local, named variables # Local, named variables
local binary="${1}"
local latesttag local latesttag
local str="Downloading and Installing FTL" local str="Downloading and Installing FTL"
printf " %b %s..." "${INFO}" "${str}" printf " %b %s..." "${INFO}" "${str}"
@ -2377,7 +2379,7 @@ FTLdetect() {
printf "\\n %b FTL Checks...\\n\\n" "${INFO}" printf "\\n %b FTL Checks...\\n\\n" "${INFO}"
if FTLcheckUpdate ; then if FTLcheckUpdate ; then
FTLinstall "${binary}" || return 1 FTLinstall || return 1
fi fi
} }