Skip full distro check on start

The distro_check function includes updating the APT cache, checking for dependencies, which is both not required on Docker start where all required packages are installed already. The only required steps from this function is the webserver user and config file names, which can be applied directly instead since we know that the Pi-hole Docker container is based on Debian.

Furthermore this solves the issue that updating the APT cache fails, when Pi-hole itself is used for DNS resolution, since pihole-FTL has not yet been started at this stage. That failure was not visible since "apt-get update" does not exist with error code (currently) when facing DNS resolving issues, even if not a single list could have been updated, and no other step is done that would require DNS resolving, until pihole-FTL is started. For a regular (non-Docker) install or update it is however reasonable to error out directly when the APT cache could not have been updated, to not defer the exit unnecessarily to a harder-to-debug stage.

Signed-off-by: MichaIng <micha@dietpi.com>
This commit is contained in:
MichaIng 2021-01-24 14:54:19 +01:00
parent 0f618ffc31
commit 512f610afa
1 changed files with 4 additions and 1 deletions

View File

@ -14,7 +14,10 @@ fix_capabilities() {
prepare_configs() {
# Done in /start.sh, don't do twice
PH_TEST=true . $PIHOLE_INSTALL
distro_check
# Set Debian webserver variables for installConfigs
LIGHTTPD_USER="www-data"
LIGHTTPD_GROUP="www-data"
LIGHTTPD_CFG="lighttpd.conf.debian"
installConfigs
touch "$setupVars"
set +e