diff options
author | nachoparker <nacho@ownyourbits.com> | 2017-07-23 20:56:06 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2017-08-11 00:17:55 +0300 |
commit | 1e98c8e93ccb58fe0dc7bd130d3d4843458c1bf7 (patch) | |
tree | a3d015b7b12d4de2df41ff837129c7f5ba47bb19 /etc/nextcloudpi-config.d/modsecurity.sh | |
parent | 41e71b4cbb02a9c3d0be01d25dd49aa39d06b8c8 (diff) |
restart HTTPd delayed on the bg, so it does not kill AJAX responsev0.17.1
Diffstat (limited to 'etc/nextcloudpi-config.d/modsecurity.sh')
-rw-r--r-- | etc/nextcloudpi-config.d/modsecurity.sh | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/etc/nextcloudpi-config.d/modsecurity.sh b/etc/nextcloudpi-config.d/modsecurity.sh index 70d07aff..14d091cf 100644 --- a/etc/nextcloudpi-config.d/modsecurity.sh +++ b/etc/nextcloudpi-config.d/modsecurity.sh @@ -76,8 +76,7 @@ a basic NextCloud installation. If a new App does not work disable it" \ configure() { - - cat >> /etc/modsecurity/modsecurity_crs_99_whitelist.conf <<EOF + cat > /etc/modsecurity/modsecurity_crs_99_whitelist.conf <<EOF <Directory $NCDIR_> # VIDEOS SecRuleRemoveById 958291 # Range Header Checks @@ -120,8 +119,10 @@ EOF [[ $ACTIVE_ == "yes" ]] && local STATE=On || local STATE=Off sed -i "s|SecRuleEngine .*|SecRuleEngine $STATE|" /etc/modsecurity/modsecurity.conf - a2enmod security2 - service apache2 restart + [[ $ACTIVE_ == "yes" ]] && a2enmod security2 || a2dismod security2 + + # delayed in bg so it does not kill the connection, and we get AJAX response + ( sleep 2 && systemctl restart apache2 ) &>/dev/null & } cleanup() |