mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-25 07:33:43 +00:00
Grouped common dependencies of distros
Signed-off-by: Wouter Servaes <wouterservaes@protonmail.com>
This commit is contained in:
parent
092891aeb4
commit
5f1e4680f7
1 changed files with 13 additions and 11 deletions
|
@ -316,8 +316,10 @@ test_dpkg_lock() {
|
||||||
|
|
||||||
# Compatibility
|
# Compatibility
|
||||||
package_manager_detect() {
|
package_manager_detect() {
|
||||||
# TODO - pull common packages for both distributions out into a common variable, then add
|
# pull common packages for both distributions out into a common variable
|
||||||
# the distro-specific ones below.
|
OS_CHECK_COMMON_DEPS=(grep)
|
||||||
|
PIHOLE_COMMON_DEPS=(curl psmisc sudo unzip jq);
|
||||||
|
INSTALLER_COMMON_DEPS=(git dialog ca-certificates)
|
||||||
|
|
||||||
# First check to see if apt-get is installed.
|
# First check to see if apt-get is installed.
|
||||||
if is_command apt-get; then
|
if is_command apt-get; then
|
||||||
|
@ -333,11 +335,11 @@ package_manager_detect() {
|
||||||
# Update package cache
|
# Update package cache
|
||||||
update_package_cache || exit 1
|
update_package_cache || exit 1
|
||||||
# Packages required to perform the os_check and FTL binary detection
|
# Packages required to perform the os_check and FTL binary detection
|
||||||
OS_CHECK_DEPS=(grep dnsutils binutils)
|
OS_CHECK_DEPS=(dnsutils binutils)
|
||||||
# Packages required to run this install script
|
# Packages required to run this install script
|
||||||
INSTALLER_DEPS=(git iproute2 dialog ca-certificates)
|
INSTALLER_DEPS=(iproute2)
|
||||||
# Packages required to run Pi-hole
|
# Packages required to run Pi-hole
|
||||||
PIHOLE_DEPS=(cron curl iputils-ping psmisc sudo unzip libcap2-bin dns-root-data libcap2 netcat-openbsd procps jq lshw bash-completion)
|
PIHOLE_DEPS=(cron iputils-ping libcap2-bin dns-root-data libcap2 netcat-openbsd procps lshw bash-completion)
|
||||||
|
|
||||||
# If apt-get is not found, check for rpm.
|
# If apt-get is not found, check for rpm.
|
||||||
elif is_command rpm; then
|
elif is_command rpm; then
|
||||||
|
@ -352,9 +354,9 @@ package_manager_detect() {
|
||||||
PKG_INSTALL=("${PKG_MANAGER}" install -y)
|
PKG_INSTALL=("${PKG_MANAGER}" install -y)
|
||||||
# CentOS package manager returns 100 when there are packages to update so we need to || true to prevent the script from exiting.
|
# CentOS package manager returns 100 when there are packages to update so we need to || true to prevent the script from exiting.
|
||||||
PKG_COUNT="${PKG_MANAGER} check-update | grep -E '(.i686|.x86|.noarch|.arm|.src|.riscv64)' | wc -l || true"
|
PKG_COUNT="${PKG_MANAGER} check-update | grep -E '(.i686|.x86|.noarch|.arm|.src|.riscv64)' | wc -l || true"
|
||||||
OS_CHECK_DEPS=(grep bind-utils)
|
OS_CHECK_DEPS=(bind-utils)
|
||||||
INSTALLER_DEPS=(git dialog iproute newt procps-ng chkconfig ca-certificates binutils)
|
INSTALLER_DEPS=(iproute newt procps-ng chkconfig binutils)
|
||||||
PIHOLE_DEPS=(cronie curl findutils sudo unzip psmisc libcap nmap-ncat jq lshw bash-completion)
|
PIHOLE_DEPS=(cronie findutils libcap nmap-ncat lshw bash-completion)
|
||||||
|
|
||||||
# If neither apt-get or yum/dnf package managers were found
|
# If neither apt-get or yum/dnf package managers were found
|
||||||
else
|
else
|
||||||
|
@ -2223,7 +2225,7 @@ main() {
|
||||||
|
|
||||||
# Install packages necessary to perform os_check
|
# Install packages necessary to perform os_check
|
||||||
printf " %b Checking for / installing Required dependencies for OS Check...\\n" "${INFO}"
|
printf " %b Checking for / installing Required dependencies for OS Check...\\n" "${INFO}"
|
||||||
install_dependent_packages "${OS_CHECK_DEPS[@]}"
|
install_dependent_packages "${OS_CHECK_COMMON_DEPS[@]}" "${OS_CHECK_DEPS[@]}"
|
||||||
|
|
||||||
# Check that the installed OS is officially supported - display warning if not
|
# Check that the installed OS is officially supported - display warning if not
|
||||||
os_check
|
os_check
|
||||||
|
@ -2240,7 +2242,7 @@ main() {
|
||||||
|
|
||||||
# Install packages used by this installation script
|
# Install packages used by this installation script
|
||||||
printf " %b Checking for / installing Required dependencies for this install script...\\n" "${INFO}"
|
printf " %b Checking for / installing Required dependencies for this install script...\\n" "${INFO}"
|
||||||
install_dependent_packages "${INSTALLER_DEPS[@]}"
|
install_dependent_packages "${INSTALLER_COMMON_DEPS[@]}" "${INSTALLER_DEPS[@]}"
|
||||||
|
|
||||||
# if it's running unattended,
|
# if it's running unattended,
|
||||||
if [[ "${runUnattended}" == true ]]; then
|
if [[ "${runUnattended}" == true ]]; then
|
||||||
|
@ -2281,7 +2283,7 @@ main() {
|
||||||
clone_or_update_repos
|
clone_or_update_repos
|
||||||
|
|
||||||
# Install the Core dependencies
|
# Install the Core dependencies
|
||||||
local dep_install_list=("${PIHOLE_DEPS[@]}")
|
local dep_install_list=("${PIHOLE_COMMON_DEPS[@]}" "${PIHOLE_DEPS[@]}")
|
||||||
|
|
||||||
# Install packages used by the actual software
|
# Install packages used by the actual software
|
||||||
printf " %b Checking for / installing Required dependencies for Pi-hole software...\\n" "${INFO}"
|
printf " %b Checking for / installing Required dependencies for Pi-hole software...\\n" "${INFO}"
|
||||||
|
|
Loading…
Reference in a new issue