aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMurray Nesbitt <github@nesbitt.ca>2022-12-29 22:23:44 -0800
committerMurray Nesbitt <github@nesbitt.ca>2022-12-29 22:23:44 -0800
commit22e9afe40d987f4f90bc8469f9475df138fe6261 (patch)
tree819b8673830d258cef79715ba2a489375cd90696
parent65de8eeeca29e71378aa34602b287ab921b040e4 (diff)
use sha256 command instead of sha256sum on FreeBSD
-rwxr-xr-xcontrib/install_db4.sh15
1 files changed, 7 insertions, 8 deletions
diff --git a/contrib/install_db4.sh b/contrib/install_db4.sh
index 2850c4b993..c7d39f5b99 100755
--- a/contrib/install_db4.sh
+++ b/contrib/install_db4.sh
@@ -32,16 +32,15 @@ check_exists() {
sha256_check() {
# Args: <sha256_hash> <filename>
#
- if check_exists sha256sum; then
- echo "${1} ${2}" | sha256sum -c
+ if [ "$(uname)" = "FreeBSD" ]; then
+ # sha256sum exists on FreeBSD, but takes different arguments than the GNU version
+ sha256 -c "${1}" "${2}"
+ elif check_exists sha256sum; then
+ echo "${1} ${2}" | sha256sum -c
elif check_exists sha256; then
- if [ "$(uname)" = "FreeBSD" ]; then
- sha256 -c "${1}" "${2}"
- else
- echo "${1} ${2}" | sha256 -c
- fi
+ echo "${1} ${2}" | sha256 -c
else
- echo "${1} ${2}" | shasum -a 256 -c
+ echo "${1} ${2}" | shasum -a 256 -c
fi
}