diff options
author | Thorsten Glaser <tg@mirbsd.org> | 2011-04-02 11:40:46 +0000 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2011-04-02 17:44:44 +0200 |
commit | 1f95e99b6fd61be1cdb891d82385e6e15ea47713 (patch) | |
tree | bac6e0fa3c7a8667f59eb201b0ac20479903c173 | |
parent | 655c3c97caad67ad2b7a482b51a648210a360316 (diff) |
port to OpenBSD and MirBSD
Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
-rwxr-xr-x | scripts/sha256sum | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/sha256sum b/scripts/sha256sum index da34d9113..2a7ffb6f7 100755 --- a/scripts/sha256sum +++ b/scripts/sha256sum @@ -4,6 +4,11 @@ if [ -x /usr/bin/sha256sum ]; then /usr/bin/sha256sum "$@" +elif [ -x /bin/cksum ] && [ $(echo | cksum -a sha256) = 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b ]; then + # we assume the arguments are exactly "-c" or "-c -" + x=$(sed 's/^\([0-9a-fA-F]*\) *\([^ ].*\)$/SHA256 (\2) = \1/' | cksum -c -a sha256) + [[ $x = *FAILED* ]] && exit 1 + exit 0 else tmp=$(mktemp -t yyy) cat - > $tmp |