mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-09-01 08:17: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
|
@ -28,8 +28,7 @@ fi
|
|||
HASH="$(doveadm pw -s SHA512-CRYPT -u "${USER}" -p "${PASSWD}")"
|
||||
|
||||
# Protect config file with lock to avoid race conditions
|
||||
(
|
||||
flock -e 200
|
||||
grep -qi "^$(escape "${USER}")|" "${DATABASE}" 2>/dev/null || errex "User \"${USER}\" does not exist"
|
||||
sed -i "s ^""${USER}""|.* ""${USER}""|""${HASH}"" " "${DATABASE}"
|
||||
) 200< "${DATABASE}"
|
||||
touch "${DATABASE}"
|
||||
create_lock "$(basename "$0")"
|
||||
grep -qi "^$(escape "${USER}")|" "${DATABASE}" 2>/dev/null || errex "User \"${USER}\" does not exist"
|
||||
sed -i "s ^""${USER}""|.* ""${USER}""|""${HASH}"" " "${DATABASE}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue