]> git.ipfire.org Git - people/stevee/network.git/commitdiff
lock: Accept names instead of paths
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 23 Sep 2018 16:04:46 +0000 (18:04 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 23 Sep 2018 16:04:46 +0000 (18:04 +0200)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/functions/functions.lock

index 8f7efc431c3dbaf41541ac04e4cc03fc727f8a78..6295a22bf2ac3cf42cefb8859db1332d1540f539 100644 (file)
@@ -33,6 +33,11 @@ lock() {
        local lock="${1}"
        shift
 
+       # Move locks with name only into lock directory
+       if [ "${lock:0:1}" != "/" ]; then
+               lock="${LOCK_DIR}/${lock}"
+       fi
+
        local timeout="60"
 
        # Make partent directory