From e2d8fd5665d5d53a9d66af59339655f1cedb14fc Mon Sep 17 00:00:00 2001 From: dkoao Date: Fri, 27 Sep 2019 09:40:09 +0000 Subject: [PATCH] check if the Nextcloud fail2ban configuration isn't already added --- setup/system.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup/system.sh b/setup/system.sh index cab05332..e3f9784d 100755 --- a/setup/system.sh +++ b/setup/system.sh @@ -341,9 +341,9 @@ systemctl restart systemd-resolved rm -f /etc/fail2ban/jail.local # we used to use this file but don't anymore rm -f /etc/fail2ban/jail.d/defaults-debian.conf # removes default config so we can manage all of fail2ban rules in one config -# Check if the user wants to enable Nextcloud, if the user wants it -# the relevant firejail configuration will be added -if [ "${DISABLE_NEXTCLOUD}" != "0"]; then +# Check if the user wants to enable Nextcloud and its rules aren't configured yet +# if both conditions are true, the relevant firejail configuration will be added +if [ "${DISABLE_NEXTCLOUD}" != "0"] && ! grep -q owncloud conf/fail2ban/jails.conf; then cat conf/fail2ban/nextcloud-jail.conf >> conf/fail2ban/jails.conf fi