author | Alberto Bertogli
<albertito@blitiri.com.ar> 2021-01-28 09:48:48 UTC |
committer | Alberto Bertogli
<albertito@blitiri.com.ar> 2021-01-28 09:48:48 UTC |
parent | 5c09138db87f10851a5c4b47948fa669b6bf57c3 |
docker/add-user.sh | +1 | -0 |
docker/entrypoint.sh | +3 | -2 |
diff --git a/docker/add-user.sh b/docker/add-user.sh index 83ee3a8..ae49e7d 100755 --- a/docker/add-user.sh +++ b/docker/add-user.sh @@ -30,6 +30,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 cat /data/dovecot/users.old | grep -v "^${EMAIL}:" \ diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index c383119..a14f578 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -95,8 +95,9 @@ done >> /etc/dovecot/auto-ssl.conf # Pick the default domain as default hostname for chasquid. This is only used # in plain text sessions and on very rare cases, and it's mostly for aesthetic # purposes. -echo "hostname: '$ONE_DOMAIN'" >> /etc/chasquid/chasquid.conf - +if ! grep -iq "hostname:" /etc/chasquid/chasquid.conf; then + echo "hostname: '$ONE_DOMAIN'" >> /etc/chasquid/chasquid.conf +fi # Start the services: dovecot in background, chasquid in foreground. start-stop-daemon --start --quiet --pidfile /run/dovecot.pid \