devops: create lock dir
This commit is contained in:
parent
98e05b66fd
commit
ae878882bb
|
|
@ -32,6 +32,7 @@ if [[ -d ${LOCKDIR} ]]; then
|
||||||
echo "Already running (lockdir $LOCKDIR exists. Remove it manually if running)"
|
echo "Already running (lockdir $LOCKDIR exists. Remove it manually if running)"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
mkdir -p $LOCKDIR
|
||||||
# make sure the lockfile is removed when we exit and then claim it
|
# make sure the lockfile is removed when we exit and then claim it
|
||||||
trap "rm -rf ${LOCKDIR}; cd $(pwd -P); exit" INT TERM EXIT
|
trap "rm -rf ${LOCKDIR}; cd $(pwd -P); exit" INT TERM EXIT
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue