mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-08-02 17:14:31 +02:00
Fail2ban logrotate interval/count: substitute only when necessary (#3919)
This commit is contained in:
parent
12f5101d84
commit
83a48e8958
2 changed files with 3 additions and 3 deletions
|
@ -209,8 +209,8 @@ function __setup__security__fail2ban() {
|
|||
rm -f /etc/logrotate.d/fail2ban
|
||||
fi
|
||||
_log 'trace' 'Configuring fail2ban logrotate rotate count and interval'
|
||||
sedfile -i "s|rotate 4$|rotate ${LOGROTATE_COUNT}|" /etc/logrotate.d/fail2ban
|
||||
sedfile -i "s|weekly$|${LOGROTATE_INTERVAL}|" /etc/logrotate.d/fail2ban
|
||||
[[ ${LOGROTATE_COUNT} -ne 4 ]] && sedfile -i "s|rotate 4$|rotate ${LOGROTATE_COUNT}|" /etc/logrotate.d/fail2ban
|
||||
[[ ${LOGROTATE_INTERVAL} != "weekly" ]] && sedfile -i "s|weekly$|${LOGROTATE_INTERVAL}|" /etc/logrotate.d/fail2ban
|
||||
}
|
||||
|
||||
function __setup__security__amavis() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue