mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-02-26 21:18:18 +00:00
Use native exit codes from dpkg-query
instead of relying on result of grep
command.
This commit is contained in:
parent
488a32e7a5
commit
7fc195a84f
1 changed files with 2 additions and 1 deletions
|
@ -79,7 +79,8 @@ if [ -x "$(command -v apt-get)" ];then
|
|||
LIGHTTPD_GROUP="www-data"
|
||||
LIGHTTPD_CFG="lighttpd.conf.debian"
|
||||
package_check() {
|
||||
dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed"
|
||||
# Returns 0 if package found locally, non-zero if package missing
|
||||
dpkg-query -W "$1" 2>/dev/null
|
||||
}
|
||||
elif [ -x "$(command -v rpm)" ];then
|
||||
# Fedora Family
|
||||
|
|
Loading…
Add table
Reference in a new issue