kiss: Fix sh256
This commit is contained in:
parent
3f65c8a725
commit
9f82ac1cd7
7
kiss
7
kiss
|
@ -114,17 +114,14 @@ sh256() {
|
||||||
#
|
#
|
||||||
# Example: '<checksum> <file>'
|
# Example: '<checksum> <file>'
|
||||||
|
|
||||||
# Skip non-files and broken symlinks.
|
if [ ! -d "$1" ] && [ -e "$1" ]; then
|
||||||
if { [ -h "$1" ] && [ -e "$1" ]; } || [ -f "$1" ]; then
|
|
||||||
hash=$(
|
hash=$(
|
||||||
sha256sum "$1" ||
|
sha256sum "$1" ||
|
||||||
sha256 -r "$1" ||
|
sha256 -r "$1" ||
|
||||||
openssl dgst -sha256 -r "$1" ||
|
openssl dgst -sha256 -r "$1" ||
|
||||||
shasum -a 256 "$1" ||
|
shasum -a 256 "$1" ||
|
||||||
digest -a sha256 "$1"
|
digest -a sha256 "$1"
|
||||||
)
|
) 2>/dev/null
|
||||||
|
|
||||||
printf '%s\n' "${hash%% *}"
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue