github.hscsec.cn/hashicorp/consul@v1.4.5/terraform/openstack/scripts/server.sh (about) 1 #!/usr/bin/env bash 2 set -e 3 4 # Read from the file we created 5 SERVER_COUNT=$(cat /tmp/consul-server-count | tr -d '\n') 6 7 # Write the flags to a temporary file 8 cat >/tmp/consul_flags << EOF 9 export CONSUL_FLAGS="-server -bootstrap-expect=${SERVER_COUNT} -data-dir=/mnt/consul" 10 EOF 11 12 # Write it to the full service file 13 sudo mv /tmp/consul_flags /etc/service/consul 14 chmod 0644 /etc/service/consul