check_curl help message

This commit is contained in:
Cyberes 2023-04-21 23:54:19 -06:00
parent 92e9006a45
commit 9fa8c95210
1 changed files with 14 additions and 6 deletions

View File

@ -3,6 +3,16 @@
# Define the usage message
usage() {
echo "Usage: $0 -u <url> [-w <warning>] [-c <critical>] [-C <contains>] [-L] [-I] [-H <headers>] [-p] [-R]"
echo "[Arguments]:
-u Specify the URL to check (required).
-w Set the warn level for response time (default: 1 second).
-c Set the critical level for response time (default: 2 seconds).
-C If the body does not contain this string, return CRITICAL.
-L Follow redirects.
-I Insecure mode (--insecure).
-H Specify headers. Formatted like \"Header1: value,Header2: value\"
-p Print the curl command and exit
-R Set curl --resolve option."
exit 3
}
@ -60,12 +70,10 @@ for value in "${values[@]}"; do
HEADER_ARGS+=' -H "'$value'" '
done
CURL_CMD=""
if $PRINT_ONLY; then
echo "curl $CURL_CMD"
exit 3
fi
#if $PRINT_ONLY; then
# echo "curl $CURL_CMD"
# exit 3
#fi
TMP_ERROR_LOG=$(mktemp)
TMP_RESPONSE=$(mktemp)