2016-03-09 16:03:31 +00:00
|
|
|
#!/usr/bin/env bash
|
2015-04-07 10:49:28 +00:00
|
|
|
set -e
|
|
|
|
|
|
|
|
# Read from the file we created
|
|
|
|
SERVER_COUNT=$(cat /tmp/consul-server-count | tr -d '\n')
|
|
|
|
|
|
|
|
# Write the flags to a temporary file
|
|
|
|
cat >/tmp/consul_flags << EOF
|
|
|
|
export CONSUL_FLAGS="-server -bootstrap-expect=${SERVER_COUNT} -data-dir=/mnt/consul"
|
|
|
|
EOF
|
|
|
|
|
|
|
|
# Write it to the full service file
|
|
|
|
sudo mv /tmp/consul_flags /etc/service/consul
|
|
|
|
chmod 0644 /etc/service/consul
|