From 9d048b2fdff7ad7318027a1a38cdcff2a4df8bc8 Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Sun, 9 Oct 2016 22:24:13 -0700 Subject: [PATCH] Move Pi-hole dependency checks to `main()` and out of duplicated `install` and `update` functions. Bring them up a level in the subshells. --- automated install/basic-install.sh | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index ef578f03..d8cc88db 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -616,25 +616,16 @@ notify_package_updates_available(){ } install_dependent_packages(){ + # Install packages passed in via argument array declare -a argArray1=("${!1}") for i in "${argArray1[@]}"; do echo -n "::: Checking for $i..." - package_check ${i} > /dev/null + package_check_install ${i} > /dev/null echo " installed!" done } -checkForDependencies() { - # Install dependencies for Pi-Hole - echo "::: Checking Pi-Hole dependencies:" - for i in "${PIHOLE_DEPS[@]}"; do - echo -n "::: Checking for $i..." - package_check_install ${i} > /dev/null - echo " installed!" - done -} - getGitFiles() { # Setup git repos for base files and web admin echo ":::" @@ -787,7 +778,6 @@ finalExports() { installPihole() { # Install base files and web interface - checkForDependencies # done stopServices setUser if [ ! -d "/var/www/html" ]; then @@ -816,7 +806,6 @@ installPihole() { updatePihole() { # Install base files and web interface - checkForDependencies # done stopServices getGitFiles installScripts @@ -934,6 +923,8 @@ if [[ ${useUpdateVars} == false ]]; then use4andor6 # Decide what upstream DNS Servers to use setDNS + # Install packages used by the Pi-hole + install_dependent_packages PIHOLE_DEPS[@] # Install and log everything to a file installPihole | tee ${tmpLog} else