Skip to content

Instantly share code, notes, and snippets.

@bluk
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bluk/e11cef5fe5e3fc803e67 to your computer and use it in GitHub Desktop.
Save bluk/e11cef5fe5e3fc803e67 to your computer and use it in GitHub Desktop.
#!/bin/bash
source /etc/environment
if etcdctl mk /consul.io/bootstrap_node ${COREOS_PRIVATE_IPV4}; then
flags=""
else
flags="::$( etcdctl get /consul.io/bootstrap_node )"
fi
CMD=`/usr/bin/docker run --rm progrium/consul cmd:run ${COREOS_PRIVATE_IPV4}${flags} -v /var/run/docker.sock:/var/run/docker.sock`
encrypt_key=`etcdctl get /consul.io/encrypt_key`
$CMD -encrypt ${encrypt_key}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment