Skip to content

Instantly share code, notes, and snippets.

@stevenuray
Created July 5, 2018 21:13
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 stevenuray/b0e40bb18be8b0784acb0f6485d5d07b to your computer and use it in GitHub Desktop.
Save stevenuray/b0e40bb18be8b0784acb0f6485d5d07b to your computer and use it in GitHub Desktop.
Dockerlith Lock Script Lock Function
lock() {
# Create lock file.
eval "exec $2>$1"
# Get exclusive, waiting lock on the file descriptor of the lock file.
flock --exclusive $2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment