Blame


1 6e0f14d5 2021-10-04 op #!/bin/sh
2 6e0f14d5 2021-10-04 op
3 6e0f14d5 2021-10-04 op # USAGE: ./sha in out
4 6e0f14d5 2021-10-04 op # writes the sha256 of in to file out
5 6e0f14d5 2021-10-04 op
6 12fcba2f 2022-02-27 op if command -v sha256 >/dev/null; then
7 6e0f14d5 2021-10-04 op exec sha256 < "$1" > "$2"
8 6e0f14d5 2021-10-04 op fi
9 6e0f14d5 2021-10-04 op
10 12fcba2f 2022-02-27 op if command -v sha256sum >/dev/null; then
11 6e0f14d5 2021-10-04 op sha256sum "$1" | awk '{print $1}' > "$2"
12 6e0f14d5 2021-10-04 op exit $?
13 6e0f14d5 2021-10-04 op fi
14 6e0f14d5 2021-10-04 op
15 6e0f14d5 2021-10-04 op echo "No sha binary found"
16 6e0f14d5 2021-10-04 op exit 1