13 lines
276 B
Bash
13 lines
276 B
Bash
#!/bin/env sh
|
|
|
|
MESSAGE="{message}"
|
|
FILE="{filename}"
|
|
EXPECTED_HASH="{filehash}"
|
|
|
|
if [ "$(sha256sum "$FILE" | awk '{print $1}')" = "$EXPECTED_HASH" ]; then
|
|
printf "File %s validated with message:\\n%s" "$FILE" "$MESSAGE"
|
|
exit 0
|
|
else
|
|
echo "File $FILE is not valid"
|
|
exit 1
|
|
fi |