summaryrefslogtreecommitdiffstats
path: root/packaging/installer/kickstart-static64.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-04-26 16:22:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-04-26 16:22:55 +0000
commitcaf1a5281f9e974ba73ceded3a782db3d0142c5f (patch)
treea09197b1fd2e984a0e8598e7007deb2a8e1969d7 /packaging/installer/kickstart-static64.sh
parentReleasing debian version 1.14.0~rc0-1. (diff)
downloadnetdata-caf1a5281f9e974ba73ceded3a782db3d0142c5f.tar.xz
netdata-caf1a5281f9e974ba73ceded3a782db3d0142c5f.zip
Merging upstream version 1.14.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging/installer/kickstart-static64.sh')
-rwxr-xr-xpackaging/installer/kickstart-static64.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/packaging/installer/kickstart-static64.sh b/packaging/installer/kickstart-static64.sh
index f6d0fc694..6ef3a1232 100755
--- a/packaging/installer/kickstart-static64.sh
+++ b/packaging/installer/kickstart-static64.sh
@@ -111,6 +111,18 @@ set_tarball_urls() {
fi
}
+safe_sha256sum() {
+ # Within the contexct of the installer, we only use -c option that is common between the two commands
+ # We will have to reconsider if we start non-common options
+ if command -v sha256sum >/dev/null 2>&1; then
+ sha256sum $@
+ elif command -v shasum >/dev/null 2>&1; then
+ shasum -a 256 $@
+ else
+ fatal "I could not find a suitable checksum binary to use"
+ fi
+}
+
# ---------------------------------------------------------------------------------------------------------------------
umask 022
@@ -157,7 +169,7 @@ progress "Downloading static netdata binary: ${NETDATA_TARBALL_URL}"
download "${NETDATA_TARBALL_CHECKSUM_URL}" "${TMPDIR}/sha256sum.txt"
download "${NETDATA_TARBALL_URL}" "${TMPDIR}/netdata-latest.gz.run"
-if ! grep netdata-latest.gz.run "${TMPDIR}/sha256sum.txt" | sha256sum --check - >/dev/null 2>&1; then
+if ! grep netdata-latest.gz.run "${TMPDIR}/sha256sum.txt" | safe_sha256sum -c - >/dev/null 2>&1; then
fatal "Static binary checksum validation failed. Stopping netdata installation and leaving binary in ${TMPDIR}"
fi