Last active
January 3, 2018 14:54
-
-
Save aduzsardi/5d7d57cc705213eb6d9553882c2b2998 to your computer and use it in GitHub Desktop.
get latest hashicorp tools
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
down_url=$(curl -s https://checkpoint-api.hashicorp.com/v1/check/$1 | jq -r .current_download_url) | |
product=$(curl -s https://checkpoint-api.hashicorp.com/v1/check/$1 | jq -r .product) | |
version=$(curl -s https://checkpoint-api.hashicorp.com/v1/check/$1 | jq -r .current_version) | |
os="linux_amd64" | |
wget ${down_url}${product}_${version}_${os}.zip | |
# There are a lot of inconsistencies in the resulting json answer between their products , so this will not work | |
# It serves just as a note to me , maybe they'll make it consistent between the tools and then you can run something like | |
# `./download consul` or `./download terraform` to download the latest version of these tools or products. | |
# In the meantime , it could be fixed with some `if else` and/or `case` statements |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment