Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
mkfifo mylock.fifo
ETCDCTL_API=3 ./bin/etcdctl lock mylock >mylock.fifo &
pid=$!
if read lockname <mylock.fifo; then
echo holding lock with key $lockname
... do whatever ...
fi
kill $pid
wait $pid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment