From 8f1fce8f4bcc795bf721da21b242cdd6b7eab364 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Tue, 10 Dec 2024 19:01:58 +0000 Subject: [PATCH] move the sourcing of utils.sh outside of installPihole Signed-off-by: Adam Warner --- automated install/basic-install.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 90eea220..b2bbb219 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1685,15 +1685,6 @@ installPihole() { exit 1 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_pihole_lighttpd_configs @@ -2426,6 +2417,15 @@ main() { # Install and log everything to a file 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_to_install_log