move the sourcing of utils.sh outside of installPihole (#5825)

This commit is contained in:
yubiuser 2024-12-11 18:32:16 +01:00 committed by GitHub
commit a41426474e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1685,15 +1685,6 @@ installPihole() {
exit 1 exit 1
fi fi
# /opt/pihole/utils.sh should be installed by installScripts now, so we can use it
if [ -f "${PI_HOLE_INSTALL_DIR}/utils.sh" ]; then
# shellcheck disable=SC1091
source "${PI_HOLE_INSTALL_DIR}/utils.sh"
else
printf " %b Failure: /opt/pihole/utils.sh does not exist .\\n" "${CROSS}"
exit 1
fi
remove_old_dnsmasq_ftl_configs remove_old_dnsmasq_ftl_configs
remove_old_pihole_lighttpd_configs remove_old_pihole_lighttpd_configs
@ -2426,6 +2417,15 @@ main() {
# Install and log everything to a file # Install and log everything to a file
installPihole | tee -a /proc/$$/fd/3 installPihole | tee -a /proc/$$/fd/3
# /opt/pihole/utils.sh should be installed by installScripts now, so we can use it
if [ -f "${PI_HOLE_INSTALL_DIR}/utils.sh" ]; then
# shellcheck disable=SC1091
source "${PI_HOLE_INSTALL_DIR}/utils.sh"
else
printf " %b Failure: /opt/pihole/utils.sh does not exist .\\n" "${CROSS}"
exit 1
fi
# Copy the temp log file into final log location for storage # Copy the temp log file into final log location for storage
copy_to_install_log copy_to_install_log