File tree Expand file tree Collapse file tree 1 file changed +36
-6
lines changed
solution_template/vm-linux-terraform/scripts Expand file tree Collapse file tree 1 file changed +36
-6
lines changed Original file line number Diff line number Diff line change @@ -8,12 +8,42 @@ sudo apt-get install unzip
88
99sudo apt-get update
1010
11- TF_VERSION=$( curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r -M " .current_version" )
12- wget -O terraform.zip https://releases.hashicorp.com/terraform/${TF_VERSION} /terraform_${TF_VERSION} _linux_amd64.zip
13- wget -O terraform.sha256 https://releases.hashicorp.com/terraform/${TF_VERSION} /terraform_${TF_VERSION} _SHA256SUMS
14- wget -O terraform.sha256.sig https://releases.hashicorp.com/terraform/${TF_VERSION} /terraform_${TF_VERSION} _SHA256SUMS.sig
15- curl -s https://keybase.io/hashicorp/pgp_keys.asc | gpg --import
16- gpg --verify terraform.sha256.sig terraform.sha256
11+ retry=0
12+ while true ; do
13+ TF_VERSION=$( curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r -M " .current_version" ) && break || (( retry++ ))
14+ (( retry >= 10 )) && break
15+ done
16+
17+ retry=0
18+ while true ; do
19+ wget -O terraform.zip https://releases.hashicorp.com/terraform/${TF_VERSION} /terraform_${TF_VERSION} _linux_amd64.zip && break || (( retry++ ))
20+ (( retry >= 10 )) && break
21+ done
22+
23+ retry=0
24+ while true ; do
25+ wget -O terraform.sha256 https://releases.hashicorp.com/terraform/${TF_VERSION} /terraform_${TF_VERSION} _SHA256SUMS && break || (( retry++ ))
26+ (( retry >= 10 )) && break
27+ done
28+
29+ retry=0
30+ while true ; do
31+ wget -O terraform.sha256.sig https://releases.hashicorp.com/terraform/${TF_VERSION} /terraform_${TF_VERSION} _SHA256SUMS.sig && break || (( retry++ ))
32+ (( retry >= 10 )) && break
33+ done
34+
35+ retry=0
36+ while true ; do
37+ curl -s https://keybase.io/hashicorp/pgp_keys.asc | gpg --import && break || (( retry++ ))
38+ (( retry >= 10 )) && break
39+ done
40+
41+ retry=0
42+ while true ; do
43+ gpg --verify terraform.sha256.sig terraform.sha256 && break || (( retry++ ))
44+ (( retry >= 10 )) && break
45+ done
46+
1747echo $( grep -Po " [[:xdigit:]]{64}(?=\s+terraform_${TF_VERSION} _linux_amd64.zip)" terraform.sha256) terraform.zip | sha256sum -c
1848unzip terraform.zip
1949mv terraform /usr/local/bin
You can’t perform that action at this time.
0 commit comments