From 7c8dbd9099b10ddefee8a7a0a7b0e2a2f8010dd5 Mon Sep 17 00:00:00 2001 From: Cyberes Date: Sat, 30 Mar 2024 21:27:07 -0600 Subject: [PATCH] fix --- check_curl.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/check_curl.sh b/check_curl.sh index de03c36..0195e13 100755 --- a/check_curl.sh +++ b/check_curl.sh @@ -418,9 +418,9 @@ elif [ $(echo "$RESPONSE_TIME_MS > $WARN_TIME" | bc) -eq 1 ]; then fi # Check critical string -BODY_CONTAINS=" " +BODY_CONTAINS="" if [ -n "$CRIT_STRING" ]; then - BODY=$(curl -s $FOLLOW_REDIRECTS $INSECURE "$HEADERS" "$RESOLVE" "$TIMEOUT" "$URL") + BODY=$(curl -s $FOLLOW_REDIRECTS $INSECURE "$HEADERS" $RESOLVE $TIMEOUT "$URL") # shellcheck disable=SC2076 if ! [[ $BODY =~ "$CRIT_STRING" ]]; then if $SANITIZE_HTML; then @@ -429,7 +429,7 @@ if [ -n "$CRIT_STRING" ]; then echo "CRITICAL - response body does not contain the required string: $BODY" exit 2 else - BODY_CONTAINS=" and contained substring " + BODY_CONTAINS=" and contained substring" fi fi @@ -441,5 +441,5 @@ else perfdata_str="| $perfdata" fi -echo "OK - response time was $RESPONSE_TIME seconds, code $HTTP_CODE.${BODY_CONTAINS}-> $URL $perfdata_str" +echo "OK - response time was $RESPONSE_TIME seconds, code $HTTP_CODE${BODY_CONTAINS}. $perfdata_str" exit 0