mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Check for installation status within the parent function.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
This commit is contained in:
parent
d5ed6c1901
commit
852341c601
1 changed files with 2 additions and 7 deletions
|
@ -97,10 +97,6 @@ if [[ $(command -v apt-get) ]]; then
|
|||
LIGHTTPD_CFG="lighttpd.conf.debian"
|
||||
DNSMASQ_USER="dnsmasq"
|
||||
|
||||
package_check() {
|
||||
dpkg-query -W -f='${Status}' "${1}" 2>/dev/null | grep "ok installed"
|
||||
return
|
||||
}
|
||||
elif [ $(command -v rpm) ]; then
|
||||
# Fedora Family
|
||||
if [ $(command -v dnf) ]; then
|
||||
|
@ -116,8 +112,7 @@ elif [ $(command -v rpm) ]; then
|
|||
PIHOLE_DEPS=(bc bind-utils cronie curl dnsmasq epel-release findutils lighttpd lighttpd-fastcgi nmap-ncat php php-common php-cli sudo unzip wget)
|
||||
|
||||
if grep -q 'Fedora' /etc/redhat-release; then
|
||||
remove_deps=(epel-release);
|
||||
PIHOLE_DEPS=( ${PIHOLE_DEPS[@]/$remove_deps} );
|
||||
PIHOLE_DEPS=(${PIHOLE_DEPS#epel-release});
|
||||
fi
|
||||
LIGHTTPD_USER="lighttpd"
|
||||
LIGHTTPD_GROUP="lighttpd"
|
||||
|
@ -756,7 +751,7 @@ install_dependent_packages() {
|
|||
if command -v debconf-apt-progress &> /dev/null; then
|
||||
for i in "${argArray1[@]}"; do
|
||||
echo -n "::: Checking for $i..."
|
||||
if package_check "${i}" &> /dev/null; then
|
||||
if dpkg-query -W -f='${Status}' "${i}" 2>/dev/null | grep "ok installed" &> /dev/null; then
|
||||
echo " installed!"
|
||||
else
|
||||
echo " added to install list!"
|
||||
|
|
Loading…
Reference in a new issue