author | Ernesto Alfonso
<erjoalgo@gmail.com> 2023-10-29 03:28:05 UTC |
committer | Alberto Bertogli
<albertito@blitiri.com.ar> 2023-10-29 22:28:08 UTC |
parent | 0ce84a3b5d14da831011d0489b5a0f335c562cdc |
docker/add-user.sh | +1 | -5 |
diff --git a/docker/add-user.sh b/docker/add-user.sh index b2aedf6..9974b1c 100755 --- a/docker/add-user.sh +++ b/docker/add-user.sh @@ -34,11 +34,7 @@ ENCPASS=$(doveadm pw -u "${EMAIL}" -p "${PASSWORD}") # Edit dovecot users: remove user if it exits. mkdir -p /data/dovecot touch /data/dovecot/users -if grep -q "^${EMAIL}:" /data/dovecot/users; then - cp /data/dovecot/users /data/dovecot/users.old - grep -v "^${EMAIL}:" /data/dovecot/users.old \ - > /data/dovecot/users -fi +sed --in-place=.old "/^${EMAIL}:/d" /data/dovecot/users # Edit dovecot users: add user. echo "${EMAIL}:${ENCPASS}::::" >> /data/dovecot/users