diff --git a/etc/nextcloudpi-config.d/modsecurity.sh b/etc/nextcloudpi-config.d/modsecurity.sh index 43639815a..37a1b8ea9 100755 --- a/etc/nextcloudpi-config.d/modsecurity.sh +++ b/etc/nextcloudpi-config.d/modsecurity.sh @@ -33,6 +33,7 @@ install() # CONFIGURE cp /etc/modsecurity/modsecurity.conf-recommended /etc/modsecurity/modsecurity.conf + sed -i "s|SecRuleEngine .*|SecRuleEngine Off|" /etc/modsecurity/modsecurity.conf sed -i 's|SecTmpDir .*|SecTmpDir /var/cache/modsecurity/|' /etc/modsecurity/modsecurity.conf sed -i 's|SecDataDir .*|SecDataDir /var/cache/modsecurity/|' /etc/modsecurity/modsecurity.conf diff --git a/etc/nextcloudpi-config.d/nc-database.sh b/etc/nextcloudpi-config.d/nc-database.sh index b00098afd..ce6c09177 100755 --- a/etc/nextcloudpi-config.d/nc-database.sh +++ b/etc/nextcloudpi-config.d/nc-database.sh @@ -32,7 +32,7 @@ configure() rmdir "$DBDIR_" } - local BASEDIR=$( dirname "$DATADIR_" ) + local BASEDIR=$( dirname "$DBDIR_" ) mkdir -p "$BASEDIR" [[ $( stat -fc%d / ) == $( stat -fc%d $BASEDIR ) ]] && \ diff --git a/etc/nextcloudpi-config.d/nc-ramlogs.sh b/etc/nextcloudpi-config.d/nc-ramlogs.sh index e90531d67..3e75286fc 100755 --- a/etc/nextcloudpi-config.d/nc-ramlogs.sh +++ b/etc/nextcloudpi-config.d/nc-ramlogs.sh @@ -32,10 +32,10 @@ tmpfs /var/log tmpfs defaults,noatime,mode=1777 0 0 # Logs in RAM tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0 # /tmp in RAM EOF - local HTTPUNIT=/etc/systemd/system/multi-user.target.wants/apache2.service + local HTTPUNIT=/lib/systemd/system/apache2.service grep -q mkdir /etc/init.d/mysql || sed -i "/\> /etc/sysctl.conf && sysctl --load echo "Logs in RAM. Reboot for changes to take effect" diff --git a/etc/nextcloudpi-config.d/nc-swapfile.sh b/etc/nextcloudpi-config.d/nc-swapfile.sh index a5ad26a79..8ff79540b 100755 --- a/etc/nextcloudpi-config.d/nc-swapfile.sh +++ b/etc/nextcloudpi-config.d/nc-swapfile.sh @@ -21,13 +21,16 @@ DESCRIPTION="Move and resize your swapfile. Recommended to move to a permanent U configure() { - [[ $( stat -fc%d / ) == $( stat -fc%d $SWAPFILE_ ) ]] && \ + local ORIG=$( grep -oP "CONF_SWAPFILE=.*" /etc/dphys-swapfile | cut -f2 -d= ) + [[ "$ORIG" == "$SWAPFILE_" ]] && return + + [[ $( stat -fc%d / ) == $( stat -fc%d $( dirname $SWAPFILE_ ) ) ]] && \ echo -e "INFO: moving swapfile to another place in the same SD card\nIf you want to use an external mount, make sure it is properly set up" sed -i "s|#\?CONF_SWAPFILE=.*|CONF_SWAPFILE=$SWAPFILE_|" /etc/dphys-swapfile sed -i "s|#\?CONF_SWAPSIZE=.*|CONF_SWAPSIZE=$SWAPSIZE_|" /etc/dphys-swapfile grep -q vm.swappiness /etc/sysctl.conf || echo "vm.swappiness = 10" >> /etc/sysctl.conf && sysctl --load - service dphys-swapfile restart + service dphys-swapfile restart && swapoff "$ORIG" && rm -f "$ORIG" } install() { :; }