Robustness improvements to netdata-updater.sh (#16613)
* Use curl -f so that non-existent URL is treated as failure * Use uname -m for default arch when PREBUILT_ARCH is missing in .install-type See #16609 Signed-off-by: Brian Candler <b.candler@pobox.com>
Brian Candler committed
Dec 15, 2023 at 13:15 UTC
488dc7779e718e99ea1d792e36d9d6cb63138038
1 file changed
+2
-1
packaging/installer/netdata-updater.sh
+2
-1
@@ -366,7 +366,7 @@ _safe_download() {
366
check_for_curl
367
368
if [ -n "${curl}" ]; then
369
- "${curl}" -sSL --connect-timeout 10 --retry 3 "${url}" > "${dest}"
369
+ "${curl}" -fsSL --connect-timeout 10 --retry 3 "${url}" > "${dest}"
370
return $?
371
elif command -v wget > /dev/null 2>&1; then
372
wget -T 15 -O - "${url}" > "${dest}"
@@ -553,6 +553,7 @@ set_tarball_urls() {
553
if [ -e /opt/netdata/etc/netdata/.install-type ]; then
554
# shellcheck disable=SC1091
555
. /opt/netdata/etc/netdata/.install-type
556
+ [ -z "${PREBUILT_ARCH:-}" ] && PREBUILT_ARCH="$(uname -m)"
557
filename="netdata-${PREBUILT_ARCH}-latest.gz.run"
558
else
559
filename="netdata-x86_64-latest.gz.run"