#!/bin/bash

###########################################################################
# Download and Install Consul                                             #
# This script is prepared for caching of the download directory           #
###########################################################################


CONSUL_VER="1.5.2"
UNAME=$(uname -s |  tr '[:upper:]' '[:lower:]')
CONSUL_ZIP="consul_${CONSUL_VER}_${UNAME}_amd64.zip"
IGNORE_CERTS="${IGNORE_CERTS:-no}"

# cleanup
mkdir -p consul
mkdir -p download

if [[ ! -f "download/${CONSUL_ZIP}" ]] ; then
    cd download
    # install Vault
    if [[ "${IGNORE_CERTS}" == "no" ]] ; then
      echo "Downloading Consul with certs verification"
      wget "https://releases.hashicorp.com/consul/${CONSUL_VER}/${CONSUL_ZIP}"
    else
      echo "WARNING... Downloading Consul WITHOUT certs verification"
      wget "https://releases.hashicorp.com/consul/${CONSUL_VER}/${CONSUL_ZIP}" --no-check-certificate
    fi

    if [[ $? != 0 ]] ; then
      echo "Cannot download Consul"
      exit 1
    fi
    cd ..
fi

cd consul

if [[ -f consul ]] ; then
  rm consul
fi

unzip ../download/${CONSUL_ZIP}
chmod a+x consul

# check
./consul --version

#!/bin/bash

###########################################################################
# Download and Install Consul                                             #
# This script is prepared for caching of the download directory           #
###########################################################################


CONSUL_VER="1.5.3"
UNAME=$(uname -s |  tr '[:upper:]' '[:lower:]')
CONSUL_ZIP="consul_${CONSUL_VER}_${UNAME}_amd64.zip"
IGNORE_CERTS="${IGNORE_CERTS:-no}"

# cleanup
mkdir -p consul
mkdir -p download

if [[ ! -f "download/${CONSUL_ZIP}" ]] ; then
    cd download
    # install Vault
    if [[ "${IGNORE_CERTS}" == "no" ]] ; then
      echo "Downloading Consul with certs verification"
      wget "https://releases.hashicorp.com/consul/${CONSUL_VER}/${CONSUL_ZIP}"
    else
      echo "WARNING... Downloading Consul WITHOUT certs verification"
      wget "https://releases.hashicorp.com/consul/${CONSUL_VER}/${CONSUL_ZIP}" --no-check-certificate
    fi

    if [[ $? != 0 ]] ; then
      echo "Cannot download Consul"
      exit 1
    fi
    cd ..
fi

cd consul

if [[ -f consul ]] ; then
  rm consul
fi

unzip ../download/${CONSUL_ZIP}
chmod a+x consul

# check
./consul --version

Update Consul version to 1.5.3.
Update Consul version to 1.5.3.

See https://github.com/hashicorp/consul/blob/master/CHANGELOG.md#153-july-25-2019

Original pull request: #344.