diff --git a/packaging/installer/README.md b/packaging/installer/README.md index b80bdfd897..5b2a9c4e5a 100644 --- a/packaging/installer/README.md +++ b/packaging/installer/README.md @@ -45,7 +45,7 @@ $ bash <(curl -Ss https://my-netdata.io/kickstart.sh) Verify the integrity of the script with this: ``` bash -[ "8a2b054081a108dff915994ce77f2f2d" = "$(curl -Ss https://my-netdata.io/kickstart.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID" +[ "b6d16c171ccad073b86327246151d875" = "$(curl -Ss https://my-netdata.io/kickstart.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID" ``` *It should print `OK, VALID` if the script is the one we ship.* @@ -101,7 +101,7 @@ $ bash <(curl -Ss https://my-netdata.io/kickstart-static64.sh) Verify the integrity of the script with this: ```bash -[ "8779d8717ccaa8dac18d599502eef591" = "$(curl -Ss https://my-netdata.io/kickstart-static64.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID" +[ "4415e8c13e529a795abb953a9be14ad5" = "$(curl -Ss https://my-netdata.io/kickstart-static64.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID" ``` *It should print `OK, VALID` if the script is the one we ship.* diff --git a/packaging/installer/kickstart-static64.sh b/packaging/installer/kickstart-static64.sh index a9f11238c2..34ca116da7 100755 --- a/packaging/installer/kickstart-static64.sh +++ b/packaging/installer/kickstart-static64.sh @@ -189,7 +189,7 @@ done # --------------------------------------------------------------------------------------------------------------------- TMPDIR=$(create_tmp_directory) -cd "${TMPDIR}" || : +cd "${TMPDIR}" set_tarball_urls "${RELEASE_CHANNEL}" progress "Downloading static netdata binary: ${NETDATA_TARBALL_URL}" @@ -202,12 +202,14 @@ fi # --------------------------------------------------------------------------------------------------------------------- progress "Installing netdata" - run ${sudo} sh "${TMPDIR}/netdata-latest.gz.run" ${opts} ${inner_opts} #shellcheck disable=SC2181 if [ $? -eq 0 ]; then - rm "${TMPDIR}/netdata-latest.gz.run" + run ${sudo} rm "${TMPDIR}/netdata-latest.gz.run" + if [ ! "${TMPDIR}" = "/" ] && [ -d "${TMPDIR}" ]; then + run ${sudo} rm -rf "${TMPDIR}" + fi else echo >&2 "NOTE: did not remove: ${TMPDIR}/netdata-latest.gz.run" fi diff --git a/packaging/installer/kickstart.sh b/packaging/installer/kickstart.sh index d396f139e3..bab95fda2e 100755 --- a/packaging/installer/kickstart.sh +++ b/packaging/installer/kickstart.sh @@ -304,7 +304,7 @@ if [ "${INTERACTIVE}" = "0" ]; then fi TMPDIR=$(create_tmp_directory) -cd ${TMPDIR} || : +cd "${TMPDIR}" dependencies @@ -328,7 +328,9 @@ cd netdata-* || fatal "Cannot cd to netdata source tree" if [ -x netdata-installer.sh ]; then progress "Installing netdata..." run ${sudo} ./netdata-installer.sh ${NETDATA_UPDATES} ${NETDATA_INSTALLER_OPTIONS} "${@}" || fatal "netdata-installer.sh exited with error" - rm -rf "${TMPDIR}" >/dev/null 2>&1 + if [ -d "${TMPDIR}" ] && [ ! "${TMPDIR}" = "/" ]; then + run ${sudo} rm -rf "${TMPDIR}" >/dev/null 2>&1 + fi else fatal "Cannot install netdata from source (the source directory does not include netdata-installer.sh). Leaving all files in ${TMPDIR}" fi