aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2017-12-20 13:33:58 +0000
committerWladimir J. van der Laan <[email protected]>2017-12-20 14:58:39 +0100
commitd95c83d193d4f16dc85cb4a81ab481cbbe41a033 (patch)
treea98ad717a16f9ca8916a38696dc20024e933a234
parentcontrib: Make X=Y arguments work in install_db4 (diff)
downloaddiscoin-d95c83d193d4f16dc85cb4a81ab481cbbe41a033.tar.xz
discoin-d95c83d193d4f16dc85cb4a81ab481cbbe41a033.zip
contrib: FreeBSD compatibility in install_db4.sh
Unfortunately, FreeBSD uses yet another syntax for `sha256`. Support FreeBSD's syntax too. Using `uname` is a bit of a hack but it works and I found no way to distinguish the two.
-rwxr-xr-xcontrib/install_db4.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/contrib/install_db4.sh b/contrib/install_db4.sh
index 909fa2eab..b57ade139 100755
--- a/contrib/install_db4.sh
+++ b/contrib/install_db4.sh
@@ -31,7 +31,11 @@ sha256_check() {
if check_exists sha256sum; then
echo "${1} ${2}" | sha256sum -c
elif check_exists sha256; then
- echo "${1} ${2}" | sha256 -c
+ if [ "$(uname)" = "FreeBSD" ]; then
+ sha256 -c "${1}" "${2}"
+ else
+ echo "${1} ${2}" | sha256 -c
+ fi
else
echo "${1} ${2}" | shasum -a 256 -c
fi