diff options
author | Ilya Mashchenko <ilya@netdata.cloud> | 2022-06-27 10:58:25 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-27 10:58:25 +0300 |
commit | 4b1691510904fbab21ab7c7cc7e27ffd1557a31c (patch) | |
tree | 8206336e9dca7d4c07c9f08068588a15bf407a4f /packaging/installer | |
parent | 862c5a9694be2069997408326f9cf7ee9403dce4 (diff) |
fix(updater): fix updating when using `--force-update` and new version of the updater script is available (#13104)
Diffstat (limited to 'packaging/installer')
-rwxr-xr-x | packaging/installer/netdata-updater.sh | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/packaging/installer/netdata-updater.sh b/packaging/installer/netdata-updater.sh index e4cb29a45e..a4f39c5d91 100755 --- a/packaging/installer/netdata-updater.sh +++ b/packaging/installer/netdata-updater.sh @@ -420,7 +420,9 @@ self_update() { if _safe_download "https://raw.githubusercontent.com/netdata/netdata/master/packaging/installer/netdata-updater.sh" ./netdata-updater.sh; then chmod +x ./netdata-updater.sh || exit 1 export ENVIRONMENT_FILE="${ENVIRONMENT_FILE}" - exec ./netdata-updater.sh --not-running-from-cron --no-updater-self-update --tmpdir-path "$(pwd)" + force_update="" + [ "$NETDATA_FORCE_UPDATE" = "1" ] && force_update="--force-update" + exec ./netdata-updater.sh --not-running-from-cron --no-updater-self-update "$force_update" --tmpdir-path "$(pwd)" else error "Failed to download newest version of updater script, continuing with current version." fi @@ -551,7 +553,11 @@ update_build() { NEW_CHECKSUM="$(safe_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 "$(find . -maxdepth 1 -name "netdata-${path_version}*" | head -n 1)" || fatal "Failed to switch to build directory" U0017 + if [ -z "$path_version" ]; then + latest_tag="$(get_latest_version)" + path_version="$(echo "${latest_tag}" | cut -f 1 -d "-")" + fi + cd "$(find . -maxdepth 1 -type d -name "netdata-${path_version}*" | head -n 1)" || fatal "Failed to switch to build directory" U0017 RUN_INSTALLER=1 fi fi |