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