Project

General

Profile

1
#!/bin/sh
2
# Wraps lockfile/dotlockfile
3
# Usage: env [interval=...] self lockfile
4

    
5
: "${interval=5}" # s
6

    
7
if test "$(uname)" = Darwin; then
8
    while ! shlock -p "$PPID" -f "$1"; do sleep "$interval"; done
9
else
10
    exec dotlockfile -l -r -1 -p "$1" # need exec to inherit PPID
11
fi
(37-37/76)