mirror of
https://github.com/adferrand/docker-backuppc.git
synced 2023-11-05 04:40:26 +01:00
Avoid to overwrite pre-defined /etc/msmtprc
This commit is contained in:
parent
650333e3aa
commit
d79dfd142d
@ -1,6 +1,10 @@
|
||||
# Changelog
|
||||
|
||||
## master - CURRENT
|
||||
### Added
|
||||
* The system configuration file `/etc/msmtprc` for `msmtprc` is not overwritten
|
||||
if it already exists at container initialization.
|
||||
|
||||
## 4.4.0-3 - 06/11/2020
|
||||
### Modified
|
||||
* Update base image to Alpine 3.12.1
|
||||
|
@ -106,14 +106,16 @@ if [ -f /firstrun ]; then
|
||||
touch /var/log/lighttpd/error.log && chown -R "$BACKUPPC_USERNAME":"$BACKUPPC_GROUPNAME" /var/log/lighttpd
|
||||
|
||||
# Configure standard mail delivery parameters (may be overriden by backuppc user-wide config)
|
||||
echo "account default" > /etc/msmtprc
|
||||
echo "logfile /var/log/msmtp.log" >> /etc/msmtprc
|
||||
echo "host ${SMTP_HOST:-mail.example.org}" >> /etc/msmtprc
|
||||
if [ "${SMTP_MAIL_DOMAIN:-}" != "" ]; then
|
||||
echo "from %U@${SMTP_MAIL_DOMAIN}" >> /etc/msmtprc
|
||||
if [ ! -f /etc/msmtprc ]; then
|
||||
echo "account default" > /etc/msmtprc
|
||||
echo "logfile /var/log/msmtp.log" >> /etc/msmtprc
|
||||
echo "host ${SMTP_HOST:-mail.example.org}" >> /etc/msmtprc
|
||||
if [ "${SMTP_MAIL_DOMAIN:-}" != "" ]; then
|
||||
echo "from %U@${SMTP_MAIL_DOMAIN}" >> /etc/msmtprc
|
||||
fi
|
||||
touch /var/log/msmtp.log
|
||||
chown "${BACKUPPC_USERNAME}:${BACKUPPC_GROUPNAME}" /var/log/msmtp.log
|
||||
fi
|
||||
touch /var/log/msmtp.log
|
||||
chown "${BACKUPPC_USERNAME}:${BACKUPPC_GROUPNAME}" /var/log/msmtp.log
|
||||
|
||||
# Clean
|
||||
rm -rf "/root/BackupPC-$BACKUPPC_VERSION.tar.gz" "/root/BackupPC-$BACKUPPC_VERSION" /firstrun
|
||||
|
@ -38,6 +38,7 @@ def main():
|
||||
"## master - CURRENT\n",
|
||||
"""\
|
||||
## master - CURRENT
|
||||
|
||||
## {0} - {1}
|
||||
""".format(
|
||||
new_version, today.strftime("%d/%m/%Y")
|
||||
|
Loading…
Reference in New Issue
Block a user