Allow uses to skip binary check and installing FTL in case the use a self-compiled binary

Signed-off-by: Christian König <github@yubiuser.dev>
This commit is contained in:
Christian König 2025-02-27 12:00:25 +01:00
parent 002536ae09
commit 56ef68eaa1
No known key found for this signature in database

View file

@ -145,6 +145,7 @@ EOM
# The runUnattended flag is one example of this
reconfigure=false
runUnattended=false
PIHOLE_SKIP_FTL_CHECK=false
# Check arguments for the undocumented flags
for var in "$@"; do
case "$var" in
@ -2422,12 +2423,16 @@ main() {
# Check if there is a usable FTL binary available on this architecture - do
# this early on as FTL is a hard dependency for Pi-hole
local funcOutput
funcOutput=$(get_binary_name) #Store output of get_binary_name here
# Abort early if this processor is not supported (get_binary_name returns empty string)
if [[ "${funcOutput}" == "" ]]; then
printf " %b Upgrade/install aborted\\n" "${CROSS}" "${DISTRO_NAME}"
exit 1
# Allow the user to skip this check if they are using a self-compiled FTL binary from an unsupported architecture
if [ ! "${PIHOLE_SKIP_FTL_CHECK}" = true ]; then
# Get the binary name for the current architecture
local funcOutput
funcOutput=$(get_binary_name) #Store output of get_binary_name here
# Abort early if this processor is not supported (get_binary_name returns empty string)
if [[ "${funcOutput}" == "" ]]; then
printf " %b Upgrade/install aborted\\n" "${CROSS}" "${DISTRO_NAME}"
exit 1
fi
fi
# in case of an update (can be a v5 -> v6 or v6 -> v6 update)
@ -2476,13 +2481,16 @@ main() {
create_pihole_user
# Download and install FTL
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")
if ! FTLdetect "${binary}" "${theRest}"; then
printf " %b FTL Engine not installed\\n" "${CROSS}"
exit 1
# Allow the user to skip this check if they are using a self-compiled FTL binary from an unsupported architecture
if [ ! "${PIHOLE_SKIP_FTL_CHECK}" = true ]; then
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")
if ! FTLdetect "${binary}" "${theRest}"; then
printf " %b FTL Engine not installed\\n" "${CROSS}"
exit 1
fi
fi
# Install and log everything to a file