Add a "trap" command so that the script erases its lock file even if it

exists prematurely.
This commit is contained in:
Laurent Rineau
2008-07-07 09:16:03 +00:00
parent 2b4ebf01f7
commit dbee2e2f50
@@ -706,6 +706,9 @@ else
MAKE_CMD='make'
fi
# that line makes the script remove the lock file in case of unwanted exit
trap "rm -f $LOCK_FILE" EXIT HUP INT TERM
# Acquire lock
lockfile -r 5 "$LOCK_FILE";
if [ ${?} != 0 ]; then