#!/bin/bash
echo 'Getting public key...'
wget https://repo.siedl.net/debian/key.asc -O /etc/apt/trusted.gpg.d/repo.siedl.net.asc || exit 1
source /etc/os-release
if [[ "$ID" = "ubuntu" ]]; then
  echo "We're on ubuntu, getting Debian version from /etc/debian_version"
  VERSION_CODENAME="$(sed -En 's/\/.*?//p' /etc/debian_version)"
fi
echo "Found Debian version: $VERSION_CODENAME"
echo 'Creating apt list /etc/apt/sources.list.d/siedl.list:'
echo "deb https://repo.siedl.net/debian ${VERSION_CODENAME} main" | tee /etc/apt/sources.list.d/siedl.list
