minio/dockerscripts/verify-minio.sh
2021-09-09 22:27:33 -07:00

32 lines
624 B
Bash
Executable File

#!/bin/sh
#
set -e
if [ ! -x "/opt/bin/minio" ]; then
echo "minio executable binary not found refusing to proceed"
exit 1
fi
verify_sha256sum() {
echo "verifying binary checksum"
echo "$(awk '{print $1}' /opt/bin/minio.sha256sum) /opt/bin/minio" | sha256sum -c
}
verify_signature() {
if [ "${TARGETARCH}" = "arm" ]; then
echo "ignoring verification of binary signature"
return
fi
echo "verifying binary signature"
minisign -VQm /opt/bin/minio -P RWTx5Zr1tiHQLwG9keckT0c45M3AGeHD6IvimQHpyRywVWGbP1aVSGav
}
main() {
verify_sha256sum
verify_signature
}
main "$@"