mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-23 07:18:07 +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
@ -97,10 +97,6 @@ if [[ $(command -v apt-get) ]]; then
|
|||||||
LIGHTTPD_CFG="lighttpd.conf.debian"
|
LIGHTTPD_CFG="lighttpd.conf.debian"
|
||||||
DNSMASQ_USER="dnsmasq"
|
DNSMASQ_USER="dnsmasq"
|
||||||
|
|
||||||
package_check() {
|
|
||||||
dpkg-query -W -f='${Status}' "${1}" 2>/dev/null | grep "ok installed"
|
|
||||||
return
|
|
||||||
}
|
|
||||||
elif [ $(command -v rpm) ]; then
|
elif [ $(command -v rpm) ]; then
|
||||||
# Fedora Family
|
# Fedora Family
|
||||||
if [ $(command -v dnf) ]; then
|
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)
|
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
|
if grep -q 'Fedora' /etc/redhat-release; then
|
||||||
remove_deps=(epel-release);
|
PIHOLE_DEPS=(${PIHOLE_DEPS#epel-release});
|
||||||
PIHOLE_DEPS=( ${PIHOLE_DEPS[@]/$remove_deps} );
|
|
||||||
fi
|
fi
|
||||||
LIGHTTPD_USER="lighttpd"
|
LIGHTTPD_USER="lighttpd"
|
||||||
LIGHTTPD_GROUP="lighttpd"
|
LIGHTTPD_GROUP="lighttpd"
|
||||||
@ -756,7 +751,7 @@ install_dependent_packages() {
|
|||||||
if command -v debconf-apt-progress &> /dev/null; then
|
if command -v debconf-apt-progress &> /dev/null; then
|
||||||
for i in "${argArray1[@]}"; do
|
for i in "${argArray1[@]}"; do
|
||||||
echo -n "::: Checking for $i..."
|
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!"
|
echo " installed!"
|
||||||
else
|
else
|
||||||
echo " added to install list!"
|
echo " added to install list!"
|
||||||
|
Loading…
Reference in New Issue
Block a user