Add OR TRUE to PKG_COUNT so that a 0 package to update doesn't grep -c to an exit value of 1.

This commit is contained in:
Dan Schaper 2016-10-09 22:27:37 -07:00
parent 9d048b2fdf
commit 61b02bf6d3

View file

@ -73,7 +73,8 @@ if [ -x "$(command -v apt-get)" ];then
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"
# grep -c will return 1 retVal on 0 matches, block this throwing the set -e with an OR TRUE
PKG_COUNT="$PKG_MANAGER -s -o Debug::NoLocking=true upgrade | grep -c ^Inst || true"
INSTALLER_DEPS=( apt-utils whiptail git dhcpcd5)
PIHOLE_DEPS=( dnsutils bc dnsmasq lighttpd ${phpVer}-common ${phpVer}-cgi curl unzip wget sudo netcat cron iproute2 )
LIGHTTPD_USER="www-data"