projects
/
experiments
/
hook-lock.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
exit-post-hook-unlock.sh: exit gracefully if LOCKDIR does not exist
[experiments/hook-lock.git]
/
exit-post-hook-unlock.sh
diff --git
a/exit-post-hook-unlock.sh
b/exit-post-hook-unlock.sh
index
d618346
..
02d3648
100755
(executable)
--- a/
exit-post-hook-unlock.sh
+++ b/
exit-post-hook-unlock.sh
@@
-14,6
+14,8
@@
set -e
LOCKDIR=/run/lock/mylockdir
+[ -d "$LOCKDIR" ] || exit 0
+
LOCKPID=$(cat "$LOCKDIR/pid")
[ "$LOCKPID" = $PPID ] || { echo "The enter script was launched from another process. Unlocking aborted." >&2; exit 1; }