#!/bin/bash

set -e
src=hashicorp
CODENAME=bookworm

cmd="curl -o /usr/share/keyrings/$src.asc https://apt.releases.hashicorp.com/gpg"
eval $cmd

cat <<EOF >/etc/apt/sources.list.d/$src.list
# https://www.hashicorp.com/blog/announcing-the-hashicorp-linux-repository
# https://www.hashicorp.com/official-packaging-guide
#   List of distro releases.
# For new GPG key use:
#   $cmd

deb [signed-by=/usr/share/keyrings/$src.asc] https://apt.releases.hashicorp.com ${CODENAME} main
EOF
