diff options
author | Gabor Meszaros <gmeszaros@users.noreply.github.com> | 2020-02-12 00:59:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-12 10:59:45 +1100 |
commit | acaae73deaa1db73d904e062eaf443d66f02b8ed (patch) | |
tree | 457172980fbdb74c1cfa556b096dc1415b6fa3ec /packaging/installer/netdata-updater.sh | |
parent | e96c1229581fc92a5c65d5e865fed9926b6466a7 (diff) |
Fixes conditional for NetData Updater when checking for new updates (#8028)
* Fix proposal for #8027
This commit changes the check for updated releases when running in manual mode
* Default (current|latest)_version to 0 and invert the logic
Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Diffstat (limited to 'packaging/installer/netdata-updater.sh')
-rwxr-xr-x | packaging/installer/netdata-updater.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/packaging/installer/netdata-updater.sh b/packaging/installer/netdata-updater.sh index fc85039dd1..198cf17305 100755 --- a/packaging/installer/netdata-updater.sh +++ b/packaging/installer/netdata-updater.sh @@ -141,10 +141,16 @@ update() { current_version="$(command -v netdata > /dev/null && parse_version "$(netdata -v | cut -f 2 -d ' ')")" latest_version="$(get_latest_version "${tmpdir}/sha256sum.txt")" + # If we can't get the current version for some reason assume `0` + current_version="${current_version:-0}" + + # If we can't get the latest version for some reason assume `0` + latest_version="${latest_version:-0}" + info "Current Version: ${current_version}" info "Latest Version: ${latest_version}" - if [ "${latest_version}" -gt 0 ] && [ "${current_version}" -gt 0 ] && [ "${current_version}" -ge "${current_version}" ]; then + if [ "${latest_version}" -gt 0 ] && [ "${current_version}" -gt 0 ] && [ "${current_version}" -ge "${latest_version}" ]; then info "Newest version ${current_version} <= ${latest_version} is already installed" elif [ -n "${NETDATA_TARBALL_CHECKSUM}" ] && grep "${NETDATA_TARBALL_CHECKSUM}" sha256sum.txt >&3 2>&3; then info "Newest version is already installed" |