From f5027776dc8079c6f0274c2cf7431454e7140497 Mon Sep 17 00:00:00 2001 From: Ivan Filonenko <40829475+SpeedyGonzaless@users.noreply.github.com> Date: Thu, 10 Jul 2025 17:21:14 +0200 Subject: [PATCH] Update misc.sh --- target/scripts/startup/setup.d/security/misc.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/target/scripts/startup/setup.d/security/misc.sh b/target/scripts/startup/setup.d/security/misc.sh index 87ed85b6..a56fecb5 100644 --- a/target/scripts/startup/setup.d/security/misc.sh +++ b/target/scripts/startup/setup.d/security/misc.sh @@ -202,13 +202,14 @@ function __setup__security__fail2ban() { fi echo '[Definition]' >/etc/fail2ban/filter.d/custom.conf + + _log 'trace' 'Configuring fail2ban logrotate rotate count and interval' + [[ ${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 else _log 'debug' 'Fail2Ban is disabled' rm -f /etc/logrotate.d/fail2ban fi - _log 'trace' 'Configuring fail2ban logrotate rotate count and interval' - [[ ${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() {