#!/bin/bash

set -e
src=gcp

cmd="curl -o /usr/share/keyrings/$src.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg"
eval $cmd

cat <<EOF >/etc/apt/sources.list.d/$cmd.list
# https://cloud.google.com/compute/docs/troubleshooting/known-issues#keyexpired-2
# For new GPG key use:
#   $cmd

deb [signed-by=/usr/share/keyrings/$src.gpg] http://packages.cloud.google.com/apt cloud-sdk main
EOF
