diff --git a/etc/nextcloudpi-config.d/nc-init.sh b/etc/nextcloudpi-config.d/nc-init.sh index b0107e0a6..77430b428 100644 --- a/etc/nextcloudpi-config.d/nc-init.sh +++ b/etc/nextcloudpi-config.d/nc-init.sh @@ -49,7 +49,7 @@ configure() # workaround to emulate DROP USER IF EXISTS ..;) local DBPASSWD=$( grep password /root/.my.cnf | cut -d= -f2 ) - mysql -u root -p$DBPASSWD <.*|'datadirectory' => '/var/www/nextcloud/data',|" "config/config.php" + sed -i "s|'datadirectory' =>.*|'datadirectory' => '/var/www/nextcloud/data',|" config/config.php sudo -u www-data php occ maintenance:mode --off sudo -u www-data php occ files:scan --all @@ -106,6 +106,9 @@ EOF fi rm -r "$TMPDIR" + # update NC database password to this instance + sed -i "s|'dbpassword' =>.*|'dbpassword' => '$DBPASSWD',|" config/config.php + # 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 }