This file contains hidden or 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 | |
source /etc/environment | |
hostname=$(cat /etc/machine-id) | |
machines=$(etcdctl ls /consul.io/bootstrap/machines) | |
#If there are 'machines' then the cluster has been initialised. | |
if [ -z "$machines" ] | |
then | |
flags="${flags} -bootstrap" |
This file contains hidden or 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 | |
# From https://gist.github.com/philips/56fa3f5dae9060fbd100 | |
source /etc/environment | |
name=$(cat /etc/machine-id) | |
if [ ! -f /opt/consul ]; then | |
mkdir /opt | |
mkdir /var/lib/consul |