summaryrefslogtreecommitdiffstats
path: root/packaging/makeself/functions.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-12-01 06:15:04 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-12-01 06:15:04 +0000
commite970e0b37b8bd7f246feb3f70c4136418225e434 (patch)
tree0b67c0ca45f56f2f9d9c5c2e725279ecdf52d2eb /packaging/makeself/functions.sh
parentAdding upstream version 1.31.0. (diff)
downloadnetdata-e970e0b37b8bd7f246feb3f70c4136418225e434.tar.xz
netdata-e970e0b37b8bd7f246feb3f70c4136418225e434.zip
Adding upstream version 1.32.0.upstream/1.32.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging/makeself/functions.sh')
-rwxr-xr-xpackaging/makeself/functions.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/packaging/makeself/functions.sh b/packaging/makeself/functions.sh
index 15818d3b2..afc8a9ac9 100755
--- a/packaging/makeself/functions.sh
+++ b/packaging/makeself/functions.sh
@@ -29,13 +29,25 @@ set -euo pipefail
# -----------------------------------------------------------------------------
fetch() {
- local dir="${1}" url="${2}"
+ local dir="${1}" url="${2}" sha256="${3}"
local tar="${dir}.tar.gz"
if [ ! -f "${NETDATA_MAKESELF_PATH}/tmp/${tar}" ]; then
run wget -O "${NETDATA_MAKESELF_PATH}/tmp/${tar}" "${url}"
fi
+ # Check SHA256 of gzip'd tar file (apparently alpine's sha256sum requires
+ # two empty spaces between the checksum and the file's path)
+ set +e
+ echo "${sha256} ${NETDATA_MAKESELF_PATH}/tmp/${tar}" | sha256sum -c -s
+ local rc=$?
+ if [ ${rc} -ne 0 ]; then
+ echo >&2 "SHA256 verification of tar file ${tar} failed (rc=${rc})"
+ echo >&2 "expected: ${sha256}, got $(sha256sum "${NETDATA_MAKESELF_PATH}/tmp/${tar}")"
+ exit 1
+ fi
+ set -e
+
if [ ! -d "${NETDATA_MAKESELF_PATH}/tmp/${dir}" ]; then
cd "${NETDATA_MAKESELF_PATH}/tmp"
run tar -zxpf "${tar}"