Files
vms/distros/opensuse/tumbleweed/update.sh
T

25 lines
534 B
Bash
Raw Normal View History

2025-08-19 20:13:08 -05:00
#!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\","
rm -r "${tmp}"