From 42cef25e41f7d5b7cab182fadeb8879f771a7478 Mon Sep 17 00:00:00 2001 From: nacho Date: Wed, 8 Nov 2017 11:01:33 +0100 Subject: [PATCH] fail2ban: update logpath on nc-datadir or nc-restore --- etc/nextcloudpi-config.d/nc-datadir.sh | 3 +++ etc/nextcloudpi-config.d/nc-restore.sh | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/etc/nextcloudpi-config.d/nc-datadir.sh b/etc/nextcloudpi-config.d/nc-datadir.sh index 102dd9269..6bf9d0023 100644 --- a/etc/nextcloudpi-config.d/nc-datadir.sh +++ b/etc/nextcloudpi-config.d/nc-datadir.sh @@ -70,6 +70,9 @@ configure() # opcache dir sed -i "s|^opcache.file_cache=.*|opcache.file_cache=$DATADIR_/.opcache|" /etc/php/7.0/mods-available/opcache.ini + # update fail2ban logpath + sed -i "s|logpath =.*|logpath = $DATADIR_/nextcloud.log|" /etc/fail2ban/jail.conf + # datadir sudo -u www-data php occ config:system:set datadirectory --value="$DATADIR_" sudo -u www-data php occ maintenance:mode --off diff --git a/etc/nextcloudpi-config.d/nc-restore.sh b/etc/nextcloudpi-config.d/nc-restore.sh index 9d3ad7236..64c3074a5 100644 --- a/etc/nextcloudpi-config.d/nc-restore.sh +++ b/etc/nextcloudpi-config.d/nc-restore.sh @@ -87,6 +87,9 @@ EOF # Just in case we moved the opcache dir sed -i "s|^opcache.file_cache=.*|opcache.file_cache=$DATADIR/.opcache|" /etc/php/7.0/mods-available/opcache.ini + # update fail2ban logpath + sed -i "s|logpath =.*|logpath = $DATADIR/nextcloud.log|" /etc/fail2ban/jail.conf + sudo -u www-data php occ maintenance:mode --off # INCLUDEDATA=no situation @@ -98,6 +101,9 @@ EOF # Just in case we moved the opcache dir sed -i "s|^opcache.file_cache=.*|opcache.file_cache=$BASEDIR/nextcloud/data/.opcache|" /etc/php/7.0/mods-available/opcache.ini + # update fail2ban logpath + sed -i "s|logpath =.*|logpath = /var/www/nextcloud/data/nextcloud.log|" /etc/fail2ban/jail.conf + sudo -u www-data php occ maintenance:mode --off sudo -u www-data php occ files:scan --all @@ -111,6 +117,9 @@ EOF systemctl start mysqld " &>/dev/null & fi + + service fail2ban restart + rm -r "$TMPDIR" }