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