This commit is contained in:
Cyberes 2024-02-26 20:44:39 -07:00
parent 17916130a2
commit 12928b3f3c
1 changed files with 2 additions and 1 deletions

View File

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