2017-09-07 18:49:22 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -o errexit
|
|
|
|
|
2018-01-08 19:02:36 +00:00
|
|
|
VERSION=0.9.1
|
2017-09-07 18:49:22 +00:00
|
|
|
DOWNLOAD=https://releases.hashicorp.com/vault/${VERSION}/vault_${VERSION}_linux_amd64.zip
|
|
|
|
|
|
|
|
function install_vault() {
|
|
|
|
if [[ -e /usr/bin/vault ]] ; then
|
|
|
|
if [ "v${VERSION}" = "$(vault version | head -n1 | awk '{print $2}')" ] ; then
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
wget -q -O /tmp/vault.zip ${DOWNLOAD}
|
|
|
|
|
|
|
|
unzip -d /tmp /tmp/vault.zip
|
|
|
|
mv /tmp/vault /usr/bin/vault
|
|
|
|
chmod +x /usr/bin/vault
|
|
|
|
}
|
|
|
|
|
|
|
|
install_vault
|