From 61b02bf6d32e72b0e16bf4a1c52ce2d5a91fbbaf Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Sun, 9 Oct 2016 22:27:37 -0700 Subject: [PATCH] Add OR TRUE to PKG_COUNT so that a 0 package to update doesn't grep -c to an exit value of 1. --- automated install/basic-install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index d8cc88db..32da07d2 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -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"