Files

24 lines
531 B
Bash
Executable File

#!env bash
set -exo pipefail
dir="$(cd "$(dirname "${0}")"; pwd)"
base="https://download.opensuse.org/repositories/systemsmanagement:/Agama:/Devel/images/iso/agama-installer.x86_64-openSUSE.iso"
# Working directory
tmp="$(mktemp -d)"
trap 'rm -rf "${tmp}"' EXIT
checksums="${tmp}/checksums"
# Read the SHA256 sum value
sums="${base}.sha256"
until curl -f -L -o "${checksums}" "${sums}"; do
sleep 1
done
sha="$(cut -d' ' -f 1 "${checksums}")"
sed -E -i \
-e "s,( checksum *=).*$,\1 \"$sha\"," \
"${dir}/amd64.pkrvars.hcl"