diff --git a/check_curl b/check_curl index 41c3833..d86ede5 100755 --- a/check_curl +++ b/check_curl @@ -75,10 +75,10 @@ for value in "${values[@]}"; do HEADER_ARGS+=' -H "'$value'" ' done -#if $PRINT_ONLY; then -# echo "curl $CURL_CMD" -# exit 3 -#fi +if $PRINT_ONLY; then + echo "curl --output \"$TMP_RESPONSE\" -s -w \"%{http_code}\n%{time_total}"\ $(echo "${HEADER_ARGS[@]}" | tr -s ' ') $FOLLOW_REDIRECTS $INSECURE $RESOLVE $URL" + exit 3 +fi TMP_ERROR_LOG=$(mktemp) TMP_RESPONSE=$(mktemp) @@ -89,6 +89,7 @@ if [ $? -ne 0 ]; then echo "CRITICAL: curl failed!" echo "Error log:" cat "$TMP_ERROR_LOG" + rm -rf "$TMP_ERROR_LOG" exit 2 fi rm -rf "$TMP_ERROR_LOG"