Difference between revisions of "Terraform quick ref"
Jump to navigation
Jump to search
(Created page with "``` #!/bin/sh set -eu if [ "$#" -ne 1 ]; then echo "Usage: $0 <terraform version>" echo "Example: $0 1.3.6" exit fi version=$1 curl -sLO https://releases.hashicorp.com/...") |
|||
Line 18: | Line 18: | ||
fi | fi | ||
unzip terraform_${version}_linux_amd64.zip | unzip terraform_${version}_linux_amd64.zip | ||
− | mv terraform /usr/local/bin/ | + | sudo mv terraform /usr/local/bin/ |
``` | ``` |
Latest revision as of 18:56, 7 December 2022
#!/bin/sh set -eu if [ "$#" -ne 1 ]; then echo "Usage: $0 <terraform version>" echo "Example: $0 1.3.6" exit fi version=$1 curl -sLO https://releases.hashicorp.com/terraform/${version}/terraform_${version}_SHA256SUMS curl -sLO https://releases.hashicorp.com/terraform/${version}/terraform_${version}_linux_amd64.zip sha256_sig=$(cat terraform_${version}_SHA256SUMS | grep terraform_${version}_linux_amd64.zip | cut -d " " -f 1) sha256_file=$(sha256sum terraform_${version}_linux_amd64.zip | awk '{print $1}') if [ ! "${sha256_file}" = "${sha256_sig}" ]; then echo "I: The sha256 for file does not match signature from web. Check file integrity." exit 1 fi unzip terraform_${version}_linux_amd64.zip sudo mv terraform /usr/local/bin/