github.com/superfly/nomad@v0.10.5-fly/scripts/vagrant-linux-priv-consul.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  set -o errexit
     4  
     5  VERSION="1.6.1"
     6  DOWNLOAD=https://releases.hashicorp.com/consul/${VERSION}/consul_${VERSION}_linux_amd64.zip
     7  
     8  function install_consul() {
     9  	if [[ -e /usr/bin/consul ]] ; then
    10  		if [ "v${VERSION}" == "$(consul version | head -n1 | awk '{print $2}')" ] ; then
    11  			return
    12  		fi
    13  	fi
    14  
    15  	wget -q -O /tmp/consul.zip ${DOWNLOAD}
    16  
    17  	unzip -d /tmp /tmp/consul.zip
    18  	mv /tmp/consul /usr/bin/consul
    19  	chmod +x /usr/bin/consul
    20  }
    21  
    22  install_consul