diff options
Diffstat (limited to 'lock')
-rwxr-xr-x | lock | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -0,0 +1,14 @@ +lock() { + + if ! mkdir "$1" &>/dev/null; then + while true; do + sleep 2; + if [[ ! -d "$1" ]]; then + return + fi + done + fi; + +} + +lock $1 |