Use flag --skipFTL instead of env var PIHOLE_SKIP_FTL_CHECK

Signed-off-by: Christian König <github@yubiuser.dev>
This commit is contained in:
Christian König 2025-07-21 11:54:12 +02:00
parent 463086ef23
commit a8db4def9a
No known key found for this signature in database
2 changed files with 26 additions and 13 deletions

View File

@ -150,7 +150,7 @@ main() {
fi fi
# Allow the user to skip this check if they are using a self-compiled FTL binary from an unsupported architecture # 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 if [ "${skipFTL}" != true ]; then
local funcOutput local funcOutput
funcOutput=$(get_binary_name) #Store output of get_binary_name here funcOutput=$(get_binary_name) #Store output of get_binary_name here
local binary local binary
@ -179,7 +179,7 @@ main() {
FTL_update=false FTL_update=false
fi fi
else else
echo -e " ${INFO} FTL:\\t\\t${COL_YELLOW}PIHOLE_SKIP_FTL_CHECK env variable set to true - update check skipped${COL_NC}" echo -e " ${INFO} FTL:\\t\\t${COL_YELLOW}--skipFTL set - update check skipped${COL_NC}"
FTL_update=false FTL_update=false
fi fi
@ -228,7 +228,14 @@ main() {
fi fi
if [[ "${FTL_update}" == true || "${core_update}" == true ]]; then if [[ "${FTL_update}" == true || "${core_update}" == true ]]; then
${PI_HOLE_FILES_DIR}/automated\ install/basic-install.sh --repair --unattended || \ local addionalFlag
if [[ ${skipFTL} == true ]]; then
addionalFlag="--skipFTL"
else
addionalFlag=""
fi
${PI_HOLE_FILES_DIR}/automated\ install/basic-install.sh --repair --unattended ${addionalFlag} || \
echo -e "${basicError}" && exit 1 echo -e "${basicError}" && exit 1
fi fi
@ -248,8 +255,15 @@ main() {
exit 0 exit 0
} }
if [[ "$1" == "--check-only" ]]; then CHECK_ONLY=false
CHECK_ONLY=true skipFTL=false
fi
# Check arguments
for var in "$@"; do
case "$var" in
"--check-only") CHECK_ONLY=true ;;
"--skipFTL") skipFTL=true ;;
esac
done
main main

View File

@ -156,14 +156,13 @@ EOM
# The runUnattended flag is one example of this # The runUnattended flag is one example of this
repair=false repair=false
runUnattended=false runUnattended=false
if [ -z "$PIHOLE_SKIP_FTL_CHECK" ]; then skipFTL=false
PIHOLE_SKIP_FTL_CHECK=false
fi
# Check arguments for the undocumented flags # Check arguments for the undocumented flags
for var in "$@"; do for var in "$@"; do
case "$var" in case "$var" in
"--repair") repair=true ;; "--repair") repair=true ;;
"--unattended") runUnattended=true ;; "--unattended") runUnattended=true ;;
"--skipFTL") skipFTL=true ;;
esac esac
done done
@ -2228,7 +2227,7 @@ main() {
# Check if there is a usable FTL binary available on this architecture - do # 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 # this early on as FTL is a hard dependency for Pi-hole
# Allow the user to skip this check if they are using a self-compiled FTL binary from an unsupported architecture # 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 if [ "${skipFTL}" != true ]; then
# Get the binary name for the current architecture # Get the binary name for the current architecture
local funcOutput local funcOutput
funcOutput=$(get_binary_name) #Store output of get_binary_name here funcOutput=$(get_binary_name) #Store output of get_binary_name here
@ -2238,7 +2237,7 @@ main() {
exit 1 exit 1
fi fi
else else
printf " %b %bPIHOLE_SKIP_FTL_CHECK env variable set to true - skipping architecture check%b\\n" "${INFO}" "${COL_YELLOW}" "${COL_NC}" printf " %b %b--skipFTL set - skipping architecture check%b\\n" "${INFO}" "${COL_YELLOW}" "${COL_NC}"
fi fi
if [[ "${fresh_install}" == false ]]; then if [[ "${fresh_install}" == false ]]; then
@ -2281,7 +2280,7 @@ main() {
# Download and install FTL # Download and install FTL
# Allow the user to skip this check if they are using a self-compiled FTL binary from an unsupported architecture # 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 if [ "${skipFTL}" != true ]; then
local binary 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) 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 local theRest
@ -2291,7 +2290,7 @@ main() {
exit 1 exit 1
fi fi
else else
printf " %b %bPIHOLE_SKIP_FTL_CHECK env variable set to true - skipping FTL binary installation%b\\n" "${INFO}" "${COL_YELLOW}" "${COL_NC}" printf " %b %b--skipFTL set - skipping FTL binary installation%b\\n" "${INFO}" "${COL_YELLOW}" "${COL_NC}"
fi fi
# Install and log everything to a file # Install and log everything to a file