Skip to content

Commit d95c83d

Browse files
committed
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.
1 parent c0298b0 commit d95c83d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

contrib/install_db4.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ sha256_check() {
3131
if check_exists sha256sum; then
3232
echo "${1} ${2}" | sha256sum -c
3333
elif check_exists sha256; then
34-
echo "${1} ${2}" | sha256 -c
34+
if [ "$(uname)" = "FreeBSD" ]; then
35+
sha256 -c "${1}" "${2}"
36+
else
37+
echo "${1} ${2}" | sha256 -c
38+
fi
3539
else
3640
echo "${1} ${2}" | shasum -a 256 -c
3741
fi

0 commit comments

Comments
 (0)