fix(updater): don't produce any output if binpkg update completed successfully (#13081)
* don't produce any output when binpkg update succeeded * redirect update repo, update netdata output to 3
Ilya Mashchenko committed
Jun 7, 2022 at 13:07 UTC
731fb01d398c1fceac6bb3a3686d67d92f0916aa
1 file changed
+5
-4
packaging/installer/netdata-updater.sh
+5
-4
@@ -764,22 +764,23 @@ update_binpkg() {
764
765
if [ -n "${repo_subcmd}" ]; then
766
# shellcheck disable=SC2086
767
- env ${env} ${pm_cmd} ${repo_subcmd} ${repo_update_opts} || fatal "Failed to update repository metadata." U000C
767
+ env ${env} ${pm_cmd} ${repo_subcmd} ${repo_update_opts} >&3 2>&3 || fatal "Failed to update repository metadata." U000C
768
fi
769
770
for repopkg in netdata-repo netdata-repo-edge; do
771
if ${pkg_installed_check} ${repopkg} > /dev/null 2>&1; then
772
# shellcheck disable=SC2086
773
- env ${env} ${pm_cmd} ${upgrade_cmd} ${pkg_install_opts} ${repopkg} || fatal "Failed to update Netdata repository config." U000D
773
+ env ${env} ${pm_cmd} ${upgrade_cmd} ${pkg_install_opts} ${repopkg} >&3 2>&3 || fatal "Failed to update Netdata repository config." U000D
774
# shellcheck disable=SC2086
775
if [ -n "${repo_subcmd}" ]; then
776
- env ${env} ${pm_cmd} ${repo_subcmd} ${repo_update_opts} || fatal "Failed to update repository metadata." U000E
776
+ env ${env} ${pm_cmd} ${repo_subcmd} ${repo_update_opts} >&3 2>&3 || fatal "Failed to update repository metadata." U000E
777
fi
778
fi
779
done
780
781
# shellcheck disable=SC2086
782
- env ${env} ${pm_cmd} ${upgrade_cmd} ${pkg_install_opts} netdata || fatal "Failed to update Netdata package." U000F
782
+ env ${env} ${pm_cmd} ${upgrade_cmd} ${pkg_install_opts} netdata >&3 2>&3 || fatal "Failed to update Netdata package." U000F
783
+ [ -n "${logfile}" ] && rm "${logfile}" && logfile=
784
}
785
786
# Simple function to encapsulate original updater behavior.