#!/bin/env bash # Upstream doc: https://adguard-dns.io/kb/adguard-home/getting-started/ set -euxo pipefail IMAGE="ubuntu/24.04" DIST="${IMAGE%%/*}" VER="${IMAGE#*/}" VER="${VER%/*}" VER="${VER//./-}" UPSTREAM_VER="10.10.6" UPSTREAM_VER_DASH="${UPSTREAM_VER//./-}" UPSTREAM_NAME="jellyfin" SERIAL="1benoitjpnet" CNAME="$UPSTREAM_NAME-$UPSTREAM_VER_DASH-$SERIAL-$DIST-$VER" ALIAS="$UPSTREAM_NAME-$UPSTREAM_VER-$SERIAL" cd "$WORKSPACE" incus launch images:$IMAGE "$CNAME" --quiet wait_network "$CNAME" incus config set "$CNAME" environment.DEBIAN_FRONTEND=noninteractive incus config set "$CNAME" environment.DEBCONF_NONINTERACTIVE_SEEN=true incus config set "$CNAME" environment.LC_ALL=C incus exec "$CNAME" -- apt-get update incus exec "$CNAME" -- apt-get upgrade -y incus exec "$CNAME" -- apt-get install -y --no-install-recommends wget curl gnupg software-properties-common incus exec "$CNAME" -- add-apt-repository universe incus exec "$CNAME" -- mkdir -p /etc/apt/keyrings incus exec "$CNAME" -- bash -c 'curl -fsSL https://repo.jellyfin.org/jellyfin_team.gpg.key | gpg --dearmor -o /etc/apt/keyrings/jellyfin.gpg' incus exec "$CNAME" -- bash -c 'export DPKG_ARCHITECTURE="$( dpkg --print-architecture )"' incus exec "$CNAME" -- bash -c 'cat < /etc/apt/sources.list.d/jellyfin.sources Types: deb URIs: https://repo.jellyfin.org/ubuntu Suites: noble Components: main Architectures: amd64 Signed-By: /etc/apt/keyrings/jellyfin.gpg EOF' incus exec "$CNAME" -- apt-get update incus exec "$CNAME" -- apt-get install -y jellyfin=${UPSTREAM_VER} incus exec "$CNAME" -- systemctl enable jellyfin laminarc run incus_publish \ CNAME="$CNAME" \ UPSTREAM_NAME=$UPSTREAM_NAME \ UPSTREAM_VER=$UPSTREAM_VER \ IMAGE=$IMAGE \ SERIAL=$SERIAL \ ALIAS=$ALIAS