mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-23 21:30:17 +00:00
Switch fedora and debian install check order
This commit is contained in:
parent
b6ceb06a32
commit
04c60e8a1c
1 changed files with 18 additions and 17 deletions
|
@ -57,7 +57,24 @@ else
|
|||
fi
|
||||
|
||||
# Compatibility
|
||||
if [ -x "$(command -v rpm)" ];then
|
||||
|
||||
if [ -x "$(command -v apt-get)" ];then
|
||||
# Debian Family
|
||||
PKG_MANAGER="apt-get"
|
||||
PKG_CACHE="/var/cache/apt"
|
||||
UPDATE_PKG_CACHE="$PKG_MANAGER -qq update"
|
||||
PKG_UPDATE="$PKG_MANAGER upgrade"
|
||||
PKG_INSTALL="$PKG_MANAGER --yes --quiet install"
|
||||
PKG_COUNT="$PKG_MANAGER -s -o Debug::NoLocking=true upgrade | grep -c ^Inst"
|
||||
INSTALLER_DEPS=( apt-utils whiptail dhcpcd5)
|
||||
PIHOLE_DEPS=( dnsutils bc dnsmasq lighttpd php5-common php5-cgi php5 git curl unzip wget sudo netcat )
|
||||
LIGHTTPD_USER="www-data"
|
||||
LIGHTTPD_GROUP="www-data"
|
||||
LIGHTTPD_CFG="lighttpd.conf.debian"
|
||||
package_check() {
|
||||
dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed"
|
||||
}
|
||||
elif [ -x "$(command -v rpm)" ];then
|
||||
# Fedora Family
|
||||
if [ -x "$(command -v dnf)" ];then
|
||||
PKG_MANAGER="dnf"
|
||||
|
@ -77,22 +94,6 @@ if [ -x "$(command -v rpm)" ];then
|
|||
package_check() {
|
||||
rpm -qa | grep ^$1- > /dev/null
|
||||
}
|
||||
elif [ -x "$(command -v apt-get)" ];then
|
||||
# Debian Family
|
||||
PKG_MANAGER="apt-get"
|
||||
PKG_CACHE="/var/cache/apt"
|
||||
UPDATE_PKG_CACHE="$PKG_MANAGER -qq update"
|
||||
PKG_UPDATE="$PKG_MANAGER upgrade"
|
||||
PKG_INSTALL="$PKG_MANAGER --yes --quiet install"
|
||||
PKG_COUNT="$PKG_MANAGER -s -o Debug::NoLocking=true upgrade | grep -c ^Inst"
|
||||
INSTALLER_DEPS=( apt-utils whiptail dhcpcd5)
|
||||
PIHOLE_DEPS=( dnsutils bc dnsmasq lighttpd php5-common php5-cgi php5 git curl unzip wget sudo netcat )
|
||||
LIGHTTPD_USER="www-data"
|
||||
LIGHTTPD_GROUP="www-data"
|
||||
LIGHTTPD_CFG="lighttpd.conf.debian"
|
||||
package_check() {
|
||||
dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed"
|
||||
}
|
||||
else
|
||||
echo "OS distribution not supported"
|
||||
exit
|
||||
|
|
Loading…
Reference in a new issue