24 lines
548 B
Bash
Executable File
24 lines
548 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-17.0.0-openSUSE-Build6.13.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"
|