Use native exit codes from dpkg-query instead of relying on result of grep command.

This commit is contained in:
Dan Schaper 2016-10-07 14:56:07 -07:00
parent 488a32e7a5
commit 7fc195a84f

View file

@ -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