summaryrefslogtreecommitdiff
path: root/scripts/checksum.sh
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2020-05-08 13:43:01 -0700
committerMichael Forney <mforney@mforney.org>2020-05-08 13:49:57 -0700
commit6a6672c57e814a93fca1db8dc79d936d2a22eaa4 (patch)
tree917d1e5f3b8e2158830d256ad580275036700ffb /scripts/checksum.sh
parentf74127556dade2c7434517caf16967e452787d79 (diff)
Detect sha256 tool automatically
Diffstat (limited to 'scripts/checksum.sh')
-rw-r--r--scripts/checksum.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/checksum.sh b/scripts/checksum.sh
new file mode 100644
index 00000000..6452d932
--- /dev/null
+++ b/scripts/checksum.sh
@@ -0,0 +1,8 @@
+if command -v sha256sum >/dev/null; then
+ exec sha256sum "$@"
+elif command -v shasum >/dev/null; then
+ exec shasum -a 256 "$@"
+else
+ printf '%s: sha256sum or shasum required\n' "$0" >&2
+ exit 1
+fi