From 01dbecb2e93aa782685c87021a1bc6912b810c4d Mon Sep 17 00:00:00 2001 From: Calvin Morrison Date: Thu, 10 Apr 2014 11:16:07 -0400 Subject: c version of lock --- lock | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100755 lock (limited to 'lock') diff --git a/lock b/lock deleted file mode 100755 index 22191fe..0000000 --- a/lock +++ /dev/null @@ -1,28 +0,0 @@ -lock() { - - if [[ -f "$1" ]]; then - echo "$1 is not a lock directory." - exit 1 - fi - - if mkdir "$1" &>/dev/null; then - echo "lock $1 created" >&2 - else - echo "lock $1 found, waiting for unlock" >&2 - while true; do - sleep 2; - if [[ ! -d "$1" ]]; then - return - fi - done - fi; - -} - -if [[ "$#" -eq "1" ]]; then - lock "$1" -else - echo "please supply one argument: the lock directory." - exit 1 -fi - -- cgit v1.2.3