mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-06-23 17:29:08 +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:
parent
ba32943986
commit
5becce8064
8 changed files with 302 additions and 273 deletions
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue