consul/terraform/aws/scripts/centos6/server.sh

16 lines
414 B
Bash
Raw Normal View History

2015-06-03 00:57:35 +00:00
#!/bin/bash
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
mv /tmp/consul_flags /etc/service/consul
chown root:root /etc/service/consul
chmod 0644 /etc/service/consul