summaryrefslogtreecommitdiffstats
path: root/claim/netdata-claim.sh.in
diff options
context:
space:
mode:
authorIlya Mashchenko <ilya@netdata.cloud>2022-02-18 11:09:22 +0300
committerGitHub <noreply@github.com>2022-02-18 11:09:22 +0300
commit3a4562ef89165089c2fa1d2e0f5142805c4c4f7c (patch)
treeadb0a829b5e23ac9b111b31406fd6ef94fd31c53 /claim/netdata-claim.sh.in
parent48aaa3dc488f10da3cd39f9a3bfd5d02c70ec7ee (diff)
fix: claiming with wget (#12163)
Diffstat (limited to 'claim/netdata-claim.sh.in')
-rwxr-xr-xclaim/netdata-claim.sh.in8
1 files changed, 6 insertions, 2 deletions
diff --git a/claim/netdata-claim.sh.in b/claim/netdata-claim.sh.in
index 9f04de0daa..4a69dbeffb 100755
--- a/claim/netdata-claim.sh.in
+++ b/claim/netdata-claim.sh.in
@@ -296,7 +296,7 @@ if [ "${URLTOOL}" = "curl" ] ; then
URLCOMMAND="${URLCOMMAND} -x \"${PROXY}\""
fi
else
- URLCOMMAND="wget -T 15 -O - -q --save-headers --content-on-error=on --method=PUT \
+ URLCOMMAND="wget -T 15 -O - -q --server-response --content-on-error=on --method=PUT \
--body-file=\"${CLAIMING_DIR}/tmpin.txt\""
if [ "${NOPROXY}" = "yes" ] ; then
URLCOMMAND="${URLCOMMAND} --no-proxy"
@@ -326,7 +326,11 @@ if [ "${VERBOSE}" == 1 ]; then
fi
attempt_contact () {
- eval "${URLCOMMAND} \"${TARGET_URL}\"" >"${CLAIMING_DIR}/tmpout.txt"
+ if [ "${URLTOOL}" = "curl" ] ; then
+ eval "${URLCOMMAND} \"${TARGET_URL}\"" >"${CLAIMING_DIR}/tmpout.txt"
+ else
+ eval "${URLCOMMAND} \"${TARGET_URL}\"" >"${CLAIMING_DIR}/tmpout.txt" 2>&1
+ fi
URLCOMMAND_EXIT_CODE=$?
if [ "${URLTOOL}" = "wget" ] && [ "${URLCOMMAND_EXIT_CODE}" -eq 8 ] ; then
# We consider the server issuing an error response a successful attempt at communicating