mirror of
https://github.com/omar-polo/gmid.git
synced 2024-10-05 00:36:58 +02:00
6e0f14d51e
While there, use it in the tests too
17 lines
285 B
Bash
Executable File
17 lines
285 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# USAGE: ./sha in out
|
|
# writes the sha256 of in to file out
|
|
|
|
if which sha256 2>/dev/null >/dev/null; then
|
|
exec sha256 < "$1" > "$2"
|
|
fi
|
|
|
|
if which sha256sum 2>/dev/null >/dev/null; then
|
|
sha256sum "$1" | awk '{print $1}' > "$2"
|
|
exit $?
|
|
fi
|
|
|
|
echo "No sha binary found"
|
|
exit 1
|