aboutsummaryrefslogtreecommitdiff
path: root/lock
diff options
context:
space:
mode:
Diffstat (limited to 'lock')
-rwxr-xr-xlock14
1 files changed, 14 insertions, 0 deletions
diff --git a/lock b/lock
new file mode 100755
index 0000000..b4b285d
--- /dev/null
+++ b/lock
@@ -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