From a885ee4668967811c44158592d74e3baef3baa22 Mon Sep 17 00:00:00 2001 From: Kevin Gallagher Date: Mon, 24 Oct 2016 14:39:52 -0700 Subject: [PATCH] Prefer sha256sum but fall back to shasum if not available One is provided by coreutils, the other is a Perl module. --- zcutil/fetch-params.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zcutil/fetch-params.sh b/zcutil/fetch-params.sh index bf6a123f1..f0ac71baf 100755 --- a/zcutil/fetch-params.sh +++ b/zcutil/fetch-params.sh @@ -9,6 +9,9 @@ BETA2_VKEY_NAME='beta2-verifying.key' BETA2_PKEY_URL="https://z.cash/downloads/$BETA2_PKEY_NAME" BETA2_VKEY_URL="https://z.cash/downloads/$BETA2_VKEY_NAME" +SHA256CMD="$(command -v sha256sum || echo shasum)" +SHA256ARGS="$(command -v sha256sum >/dev/null || echo '-a 256')" + function fetch_params { local url="$1" local output="$2" @@ -25,7 +28,7 @@ function fetch_params { --retry-connrefused --waitretry=3 --timeout=30 \ "$url" - shasum -a 256 --check <