diff options
| author | Waldemar Brodkorb <wbx@openadk.org> | 2011-04-03 17:30:37 +0200 |
|---|---|---|
| committer | Waldemar Brodkorb <wbx@openadk.org> | 2011-04-03 17:30:37 +0200 |
| commit | bca9dca1113c6687dd82fedeec6b916d730edad9 (patch) | |
| tree | 6f0ab33c674f09bd54d51256a14d0d1c982a77a0 /scripts/sha256sum | |
| parent | d90ffd11c468951c4801013ffcaf5178fb6548e8 (diff) | |
| parent | 45ec86f9056dc8b7c2718a28ef7ac0cff6b7701e (diff) | |
Merge branch 'master' of git+ssh://openadk.org/git/openadk
Diffstat (limited to 'scripts/sha256sum')
| -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 |
