mirror of
https://github.com/tomav/docker-mailserver
synced 2025-09-01 06:45:44 +00: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:
@@ -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
|
||||
{
|
||||
|
Reference in New Issue
Block a user