display failures iff greater than 0

This commit is contained in:
Asif Bacchus 2020-09-15 23:20:05 -06:00
parent d3eab06714
commit 65cebd4845

View File

@ -155,7 +155,18 @@ done
### display results
printf "\n%sResults:%s\n" "$cyan" "$norm"
printf "\tUpdates: %s available\n" "$updatesAvailable"
printf "\tDownloads: %s successful, %s%s failed%s\n" "$downloadSuccess" "$err" "$downloadFailed" "$norm"
printf "\tUpdates: %s applied, %s%s failed%s\n\n" "$updateSuccess" "$err" "$updateFailed" "$norm"
if [ "$updatesAvailable" -gt '0' ]; then
if [ "$downloadFailed" -gt '0' ]; then
printf "\tDownloads: %s successful, %s%s failed%s\n" "$downloadSuccess" "$err" "$downloadFailed" "$norm"
else
printf "\tDownloads: %s successful\n" "$downloadSuccess"
fi
if [ "$updateFailed" -gt '0' ]; then
printf "\tUpdates: %s applied, %s%s failed%s\n\n" "$updateSuccess" "$err" "$updateFailed" "$norm"
else
printf "\tUpdates: %s applied\n\n" "$updateSuccess"
fi
fi
exit 0
exit 0
#EOF