check_curl: fix body contains
This commit is contained in:
parent
1c21029188
commit
e792c43c09
|
@ -45,7 +45,7 @@ while getopts "u:w:c:C:LH:M:IpR:st:h" opt; do
|
|||
CRIT_STRING="$OPTARG"
|
||||
;;
|
||||
L)
|
||||
FOLLOW_REDIRECTS="--location"
|
||||
FOLLOW_REDIRECTS="-L"
|
||||
;;
|
||||
I)
|
||||
INSECURE="--insecure"
|
||||
|
@ -397,7 +397,8 @@ fi
|
|||
# Check critical string
|
||||
if [ -n "$CRIT_STRING" ]; then
|
||||
BODY=$(curl -s $FOLLOW_REDIRECTS $INSECURE $HEADERS $RESOLVE $TIMEOUT $URL)
|
||||
if ! echo "$BODY" | grep -q "$CRIT_STRING"; then
|
||||
if ! [[ $BODY =~ "$CRIT_STRING" ]]; then
|
||||
# if ! echo "$BODY" | grep -q "$CRIT_STRING"; then
|
||||
echo "CRITICAL - response body does not contain '$CRIT_STRING': $BODY"
|
||||
exit 2
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue