From 2144a1fa25d58c93677c110bcbfdc58023d0cf45 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Tue, 8 May 2018 17:46:34 +0200 Subject: [PATCH] exit-post-hook-unlock.sh: exit gracefully if LOCKDIR does not exist If LOCKDIR does not exist it means that the lock is not active so there's no need to do anything. --- exit-post-hook-unlock.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exit-post-hook-unlock.sh b/exit-post-hook-unlock.sh index d618346..02d3648 100755 --- 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; } -- 2.1.4