2
0
mirror of https://github.com/status-im/consul.git synced 2025-02-19 00:56:45 +00:00
2014-10-11 17:10:05 -07:00

26 lines
502 B
Plaintext

description "Join the consul cluster"
start on started consul
stop on stopped consul
task
script
if [ -f "/etc/service/consul-join" ]; then
. /etc/service/consul-join
fi
# Keep trying to join until it succeeds
set +e
while :; do
logger -t "consul-join" "Attempting join: ${CONSUL_JOIN}"
/usr/local/bin/consul join \
${CONSUL_JOIN} \
>>/var/log/consul-join.log 2>&1
[ $? -eq 0 ] && break
sleep 5
done
logger -t "consul-join" "Join success!"
end script