prevent ./automated install/basic-install.sh: line 1886: /usr/bin/pihole-FTL: No such file or directory on new install, or if pihole-FTL is missing for whatever reason.

Signed-off-by: Adam Warner <adamw@rner.email>
This commit is contained in:
Adam Warner 2017-07-25 22:49:06 +01:00
parent 1c93868ae1
commit a293b5a371
No known key found for this signature in database
GPG key ID: 03843F6C65554B22

View file

@ -1883,6 +1883,10 @@ FTLdetect() {
#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
echo -e " ${INFO} Checking for existing FTL binary..." echo -e " ${INFO} Checking for existing FTL binary..."
local ftlLoc=$(which pihole-FTL)
if [[ ${ftlLoc} ]]; then
local FTLversion=$(/usr/bin/pihole-FTL tag) local FTLversion=$(/usr/bin/pihole-FTL tag)
local FTLlatesttag=$(curl -sI https://github.com/pi-hole/FTL/releases/latest | grep 'Location' | awk -F '/' '{print $NF}' | tr -d '\r\n') local FTLlatesttag=$(curl -sI https://github.com/pi-hole/FTL/releases/latest | grep 'Location' | awk -F '/' '{print $NF}' | tr -d '\r\n')
@ -1902,6 +1906,12 @@ FTLdetect() {
echo -e " ${INFO} Checksum correct. No need to download!" echo -e " ${INFO} Checksum correct. No need to download!"
fi fi
fi fi
else
# Install FTL
FTLinstall "${binary}" || return 1
fi
} }
main() { main() {