mirror of
https://github.com/omar-polo/gmid.git
synced 2024-09-30 06:21:19 +02:00
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
|