diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-04-17 17:57:35 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-04-17 17:57:35 +0000 |
commit | 3b95e5be69c199a2a195c57aba12d88c242225ac (patch) | |
tree | 137b72ffaefe7f34bf21e975ccc9cc9ec0474564 /packaging/installer/netdata-updater.sh | |
parent | Adding upstream version 1.13.0. (diff) | |
download | netdata-b9ac22f8da656f8703bea7c713068a397e01c714.tar.xz netdata-b9ac22f8da656f8703bea7c713068a397e01c714.zip |
Adding upstream version 1.14.0~rc0.upstream/1.14.0_rc0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging/installer/netdata-updater.sh')
-rw-r--r-- | packaging/installer/netdata-updater.sh | 53 |
1 files changed, 26 insertions, 27 deletions
diff --git a/packaging/installer/netdata-updater.sh b/packaging/installer/netdata-updater.sh index 2dce5efc1..071198dd6 100644 --- a/packaging/installer/netdata-updater.sh +++ b/packaging/installer/netdata-updater.sh @@ -77,36 +77,35 @@ update() { download "${NETDATA_TARBALL_CHECKSUM_URL}" "${dir}/sha256sum.txt" >&3 2>&3 if grep "${NETDATA_TARBALL_CHECKSUM}" sha256sum.txt >&3 2>&3; then info "Newest version is already installed" - exit 0 - fi - - download "${NETDATA_TARBALL_URL}" "${dir}/netdata-latest.tar.gz" - if ! grep netdata-latest.tar.gz sha256sum.txt | sha256sum --check - >&3 2>&3; then - failed "Tarball checksum validation failed. Stopping netdata upgrade and leaving tarball in ${dir}" - fi - NEW_CHECKSUM="$(sha256sum netdata-latest.tar.gz 2>/dev/null| cut -d' ' -f1)" - tar -xf netdata-latest.tar.gz >&3 2>&3 - rm netdata-latest.tar.gz >&3 2>&3 - cd netdata-* - - # signal netdata to start saving its database - # this is handy if your database is big - pids=$(pidof netdata) - do_not_start= - if [ -n "${pids}" ]; then - #shellcheck disable=SC2086 - kill -USR1 ${pids} else - # netdata is currently not running, so do not start it after updating - do_not_start="--dont-start-it" - fi - - info "Re-installing netdata..." - eval "${REINSTALL_COMMAND} --dont-wait ${do_not_start}" >&3 2>&3 || fatal "FAILED TO COMPILE/INSTALL NETDATA" - sed -i '/NETDATA_TARBALL/d' "${ENVIRONMENT_FILE}" - cat <<EOF >>"${ENVIRONMENT_FILE}" + download "${NETDATA_TARBALL_URL}" "${dir}/netdata-latest.tar.gz" + if ! grep netdata-latest.tar.gz sha256sum.txt | sha256sum --check - >&3 2>&3; then + failed "Tarball checksum validation failed. Stopping netdata upgrade and leaving tarball in ${dir}" + fi + NEW_CHECKSUM="$(sha256sum netdata-latest.tar.gz 2>/dev/null| cut -d' ' -f1)" + tar -xf netdata-latest.tar.gz >&3 2>&3 + rm netdata-latest.tar.gz >&3 2>&3 + cd netdata-* + + # signal netdata to start saving its database + # this is handy if your database is big + pids=$(pidof netdata) + do_not_start= + if [ -n "${pids}" ]; then + #shellcheck disable=SC2086 + kill -USR1 ${pids} + else + # netdata is currently not running, so do not start it after updating + do_not_start="--dont-start-it" + fi + + info "Re-installing netdata..." + eval "${REINSTALL_COMMAND} --dont-wait ${do_not_start}" >&3 2>&3 || fatal "FAILED TO COMPILE/INSTALL NETDATA" + sed -i '/NETDATA_TARBALL/d' "${ENVIRONMENT_FILE}" + cat <<EOF >>"${ENVIRONMENT_FILE}" NETDATA_TARBALL_CHECKSUM="$NEW_CHECKSUM" EOF + fi rm -rf "${dir}" >&3 2>&3 [ -n "${logfile}" ] && rm "${logfile}" && logfile= |