mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 10:43:55 +00:00
Move Pi-hole dependency checks to main()
and out of duplicated install
and update
functions. Bring them up a level in the subshells.
This commit is contained in:
parent
d9e28a7422
commit
9d048b2fdf
1 changed files with 4 additions and 13 deletions
|
@ -616,25 +616,16 @@ notify_package_updates_available(){
|
||||||
}
|
}
|
||||||
|
|
||||||
install_dependent_packages(){
|
install_dependent_packages(){
|
||||||
|
# Install packages passed in via argument array
|
||||||
declare -a argArray1=("${!1}")
|
declare -a argArray1=("${!1}")
|
||||||
|
|
||||||
for i in "${argArray1[@]}"; do
|
for i in "${argArray1[@]}"; do
|
||||||
echo -n "::: Checking for $i..."
|
echo -n "::: Checking for $i..."
|
||||||
package_check ${i} > /dev/null
|
package_check_install ${i} > /dev/null
|
||||||
echo " installed!"
|
echo " installed!"
|
||||||
done
|
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() {
|
getGitFiles() {
|
||||||
# Setup git repos for base files and web admin
|
# Setup git repos for base files and web admin
|
||||||
echo ":::"
|
echo ":::"
|
||||||
|
@ -787,7 +778,6 @@ finalExports() {
|
||||||
|
|
||||||
installPihole() {
|
installPihole() {
|
||||||
# Install base files and web interface
|
# Install base files and web interface
|
||||||
checkForDependencies # done
|
|
||||||
stopServices
|
stopServices
|
||||||
setUser
|
setUser
|
||||||
if [ ! -d "/var/www/html" ]; then
|
if [ ! -d "/var/www/html" ]; then
|
||||||
|
@ -816,7 +806,6 @@ installPihole() {
|
||||||
|
|
||||||
updatePihole() {
|
updatePihole() {
|
||||||
# Install base files and web interface
|
# Install base files and web interface
|
||||||
checkForDependencies # done
|
|
||||||
stopServices
|
stopServices
|
||||||
getGitFiles
|
getGitFiles
|
||||||
installScripts
|
installScripts
|
||||||
|
@ -934,6 +923,8 @@ if [[ ${useUpdateVars} == false ]]; then
|
||||||
use4andor6
|
use4andor6
|
||||||
# Decide what upstream DNS Servers to use
|
# Decide what upstream DNS Servers to use
|
||||||
setDNS
|
setDNS
|
||||||
|
# Install packages used by the Pi-hole
|
||||||
|
install_dependent_packages PIHOLE_DEPS[@]
|
||||||
# Install and log everything to a file
|
# Install and log everything to a file
|
||||||
installPihole | tee ${tmpLog}
|
installPihole | tee ${tmpLog}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue