From 12928b3f3c5c5d2500277ab54fba1be18ed41a87 Mon Sep 17 00:00:00 2001 From: Cyberes Date: Mon, 26 Feb 2024 20:44:39 -0700 Subject: [PATCH] adjust --- check_apt_critical.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/check_apt_critical.sh b/check_apt_critical.sh index 26dd8aa..f44b75c 100755 --- a/check_apt_critical.sh +++ b/check_apt_critical.sh @@ -41,7 +41,8 @@ fi if [[ $CRIT_LEVEL -gt 0 ]] || [[ $WARN_LEVEL -gt 0 ]]; then # Only use the levels if the user has set one of them. - if [[ $NUM_CRIT_UPDATES -ge $CRIT_LEVEL ]]; then + if [[ $CRIT_LEVEL -gt 0 ]] && [[ $NUM_CRIT_UPDATES -ge $CRIT_LEVEL ]]; then + # If the crit level is 0, that means the user has only set the --warn flag. We'll just ignore the crit level since that's what they did. echo "CRITICAL - $NUM_CRIT_UPDATES critical updates available. | critical_updates=$NUM_CRIT_UPDATES" exit 2 elif [[ $NUM_CRIT_UPDATES -ge $WARN_LEVEL ]]; then