You've already forked docker-mailserver
mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-08-08 23:06:49 +02:00
Lock file create and remove improvements (#2183)
* changed the locking function to better support multiple servers running at once and sharing the same config * helper function testing now runs inside of container Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
This commit is contained in:
@ -42,9 +42,8 @@ PASSWD="${*}"
|
||||
[[ -z ${FULL_EMAIL} ]] && { __usage ; errex 'No username specified' ; }
|
||||
[[ "${FULL_EMAIL}" =~ .*\@.* ]] || { __usage ; errex 'Username must include the domain' ; }
|
||||
|
||||
# Protect config file with lock to avoid race conditions
|
||||
touch "${DATABASE}"
|
||||
create_lock "$(basename "$0")"
|
||||
create_lock # Protect config file with lock to avoid race conditions
|
||||
if grep -qi "^$(escape "${FULL_EMAIL}")|" "${DATABASE}"
|
||||
then
|
||||
echo "User '${FULL_EMAIL}' already exists."
|
||||
|
Reference in New Issue
Block a user