summaryrefslogtreecommitdiffstats
path: root/claim/netdata-claim.sh.in
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-04-14 18:12:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-04-14 18:12:10 +0000
commitb5321aff06d6ea8d730d62aec2ffd8e9271c1ffc (patch)
tree36c41e35994786456154f9d3bf88c324763aeea4 /claim/netdata-claim.sh.in
parentAdding upstream version 1.33.1. (diff)
downloadnetdata-b5321aff06d6ea8d730d62aec2ffd8e9271c1ffc.tar.xz
netdata-b5321aff06d6ea8d730d62aec2ffd8e9271c1ffc.zip
Adding upstream version 1.34.0.upstream/1.34.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'claim/netdata-claim.sh.in')
-rwxr-xr-xclaim/netdata-claim.sh.in12
1 files changed, 8 insertions, 4 deletions
diff --git a/claim/netdata-claim.sh.in b/claim/netdata-claim.sh.in
index 9f04de0da..73f016623 100755
--- a/claim/netdata-claim.sh.in
+++ b/claim/netdata-claim.sh.in
@@ -152,7 +152,7 @@ gen_id() {
local id
if command -v uuidgen > /dev/null 2>&1; then
- id="$(uuidgen)"
+ id="$(uuidgen | tr '[:upper:]' '[:lower:]')"
elif [ -r /proc/sys/kernel/random/uuid ]; then
id="$(cat /proc/sys/kernel/random/uuid)"
else
@@ -199,7 +199,7 @@ do
case $arg in
-token=*) TOKEN=${arg:7} ;;
-url=*) [ -n "${arg:5}" ] && URL_BASE=${arg:5} ;;
- -id=*) ID=${arg:4} ;;
+ -id=*) ID=$(echo "${arg:4}" | tr '[:upper:]' '[:lower:]');;
-rooms=*) ROOMS=${arg:7} ;;
-hostname=*) HOSTNAME=${arg:10} ;;
-verbose) VERBOSE=1 ;;
@@ -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