fix: check if gpg keyrings exist
This commit is contained in:
@@ -7,11 +7,10 @@
|
||||
|
||||
if ! command -v "terraform" &>/dev/null; then
|
||||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
# https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli#install-terraform
|
||||
wget -O- https://apt.releases.hashicorp.com/gpg |
|
||||
gpg --dearmor |
|
||||
sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg >/dev/null
|
||||
|
||||
terraform_keyring_path="/usr/share/keyrings/hashicorp-archive-keyring.gpg"
|
||||
if [[ ! -f "$terraform_keyring_path" ]]; then
|
||||
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o "$terraform_keyring_path"
|
||||
fi
|
||||
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] \
|
||||
https://apt.releases.hashicorp.com $(lsb_release -cs) main" |
|
||||
sudo tee /etc/apt/sources.list.d/hashicorp.list
|
||||
|
||||
Reference in New Issue
Block a user