#!/bin/bash set -euxo pipefail go2rtc_version="1.10.0" # sha256 digests of the release archives; update when bumping go2rtc_version. declare -A go2rtc_checksums=( ["amd64"]="345d02a82ccd36028d98ef821cdc50cedabe919710c0d7506a86ed0e397d179b" ["arm64"]="8951fda217fd637969b9936c8fc49ab2392e87fea6979b2ee99b755a70a8399d" ) dest_dir="/rootfs/usr/local/go2rtc/bin" tarball="/tmp/go2rtc_linux_${TARGETARCH}.tar.gz" mkdir -p "${dest_dir}" wget -qO "${tarball}" \ "https://github.com/AlexxIT/go2rtc/releases/download/v${go2rtc_version}/go2rtc_linux_${TARGETARCH}.tar.gz" echo "${go2rtc_checksums[${TARGETARCH}]} ${tarball}" | sha256sum -c - tar -xzOf "${tarball}" "go2rtc_linux_${TARGETARCH}" > "${dest_dir}/go2rtc" rm -f "${tarball}" chmod 755 "${dest_dir}/go2rtc"