2023-09-21 22:12:46 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -o errexit -o nounset -o pipefail
|
|
|
|
|
|
|
|
NAME="$1"
|
|
|
|
NAME_UPPER="$(echo $NAME | tr '[a-z]' '[A-Z]')"
|
|
|
|
shift
|
|
|
|
|
|
|
|
cat <<EOF
|
|
|
|
${NAME_UPPER}_INTEGRITY = {
|
|
|
|
EOF
|
|
|
|
|
2023-12-08 08:30:39 +00:00
|
|
|
while (($# > 0)); do
|
2023-09-21 22:12:46 +00:00
|
|
|
|
|
|
|
if [[ "$1" =~ .*.sha256 ]]; then
|
|
|
|
base=$(basename $1)
|
|
|
|
base="${base/"$NAME-"/}"
|
|
|
|
base="${base/".sha256"/}"
|
|
|
|
base="${base/".exe"/}"
|
|
|
|
cat <<EOF
|
|
|
|
"${base}": "sha256-$(cat $1 | awk '{ print $1 }' | xxd -r -p | base64)",
|
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
2023-09-24 22:06:10 +00:00
|
|
|
echo -n "}"
|
2023-09-21 22:12:46 +00:00
|
|
|
echo ""
|