The return code of `FTLdetect()` is used in the installer to know whether FTL has been installed or not.
The function however returns an error only, if the download of FTL fails, not if checking for a latest version/update of FTL fails. This way, installs and rapairs can continue without or with ourdated FTL until `pihole-FTL migrate v6`, which hangs endlessly, if it is a v5 FTL.
This commit handles the return code in `FTLdetect()`, and lets it return true only if FTL download succeeded, or if the update check succeeded and FTL is up-to-date. Else, it could neither be repaired, nor installed, and the error message should give a hint what went wrong, hence exit.
`FTLdetect()` is not called by any other script, hence this change has no surprising effect elsewhere.
Additionally, a syntax error in the `FTLcheckUpdate()` function itself is fixed, which masks the `check_download_exists()` return code, hence always leads to error code 4, if the FTL branch is not `master`.
Signed-off-by: MichaIng <micha@dietpi.com>
Add cron-daemon virtual package as an alternative dependency. This way
pihole-meta by default still depends on cron, but allows installation of
systemd-cron, which completely replaces cron daemon and package. With
systemd-cron functionality of crontab files and /etc/cron.* directories
works expected, as systemd-cron generates systemd timers from cron
files.
Signed-off-by: Ihor Urazov <iurazov@healthjoy.com>
Alters the test for IPv4 route so the installer doesn't fail instantly on IPv6-only.
Gives user a dialog to proceed with IPv6 only installation
Switches DNS server options to only contain IPv6 addresses.
Signed-off-by: Rob Gill <rrobgill@protonmail.com>
readonly ADMIN_INTERFACE_DIR=$(getFTLConfigValue "webserver.paths.webroot")$(getFTLConfigValue "webserver.paths.webhome")
^-----------------^ SC2155 (warning): Declare and assign separately to avoid masking return values.
In ./advanced/Scripts/update.sh line 39:
readonly ADMIN_INTERFACE_DIR=$(getFTLConfigValue "webserver.paths.webroot")$(getFTLConfigValue "webserver.paths.webhome")
^-----------------^ SC2155 (warning): Declare and assign separately to avoid masking return values.
In ./advanced/Scripts/updatecheck.sh line 45:
readonly ADMIN_INTERFACE_DIR=$(getFTLConfigValue "webserver.paths.webroot")$(getFTLConfigValue "webserver.paths.webhome")
^-----------------^ SC2155 (warning): Declare and assign separately to avoid masking return values.
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
local status=$(curl --head --silent "https://ftl.pi-hole.net/${1}" | head -n 1)
^----^ SC2155 (warning): Declare and assign separately to avoid masking return values.
In ./automated install/basic-install.sh line 2076:
elif [ $? -eq 2 ]; then
^-- SC2319 (warning): This $? refers to a condition, not a command. Assign to a variable to avoid it being overwritten.
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
- Move random password generation block inside final "fresh install" if block, ensure password is ONLY generated on fresh installs.
- Add additional check for fresh install around setting of PIHOLE_DNS1/2, QUERY_LOGGING, and PRIVACY_LEVEL
- Remove dedicated displayFinalMessage function.
Signed-off-by: Adam Warner <me@adamwarner.co.uk>