1
0
mirror of https://github.com/docker-mailserver/docker-mailserver.git synced 2025-06-16 03:40:36 +02:00

chore(scripts): Removing flock so NFS works (#1980)

Co-authored-by: Casper <casperklein@users.noreply.github.com>
Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
This commit is contained in:
Nathan Pierce
2021-06-15 08:03:41 -04:00
committed by GitHub
parent ba32943986
commit 5becce8064
8 changed files with 302 additions and 273 deletions

View File

@ -15,7 +15,22 @@ function escape
echo "${1//./\\.}"
}
# ? --------------------------------------------- IP & CIDR
function create_lock
{
SCRIPT_NAME="$1"
LOCK_FILE="/tmp/docker-mailserver/${SCRIPT_NAME}.lock"
[[ -e "${LOCK_FILE}" ]] && errex "Lock file ${LOCK_FILE} exists. Another $1 execution is happening. Try again later."
trap remove_lock EXIT # This won't work if the script is, for example, check-for-changes.sh which uses a while loop to stay running; you'll need to include a remove_lock call at the end of your logic
touch "${LOCK_FILE}"
}
function remove_lock
{
SCRIPT_NAME=${SCRIPT_NAME:-$1}
rm -f "/tmp/docker-mailserver/${SCRIPT_NAME}.lock"
}
# ? ––––––––––––––––––––––––––––––––––––––––––––– IP & CIDR
function _mask_ip_digit
{