Make tests in the correct order

This commit is contained in:
Alarig Le Lay 2018-08-29 16:09:36 +02:00
parent 332c62e5ca
commit f0e60e3a30
1 changed files with 5 additions and 5 deletions

View File

@ -113,10 +113,7 @@ ROUTE_HIT_OUT="$($birdc show protocol all ${SESSION} | \
case ${STATE} in
Established)
if [ ${RATIO_IN} -lt 90 ]; then
printf "OK: ${SESSION} is ${STATE}\n"
exit 0
elif [ "${ROUTE_HIT_IN}" != "" ]; then
if [ "${ROUTE_HIT_IN}" != "" ]; then
printf "CRITICAL: ${SESSION} has hit import route "
printf "limit\n"
exit 2
@ -124,10 +121,13 @@ case ${STATE} in
printf "CRITICAL: ${SESSION} has hit export route "
printf "limit\n"
exit 2
else
elif [ ${RATIO_IN} -gt 90 ]; then
printf "WARNING: ${SESSION} import route limit is "
printf "over thresold\n"
exit 1
else
printf "OK: ${SESSION} is ${STATE}\n"
exit 0
fi
;;
OpenSent | OpenConfirm)