# TODO: Your Nextcloud database user
dbUser="nextcloud_db_user"
# TODO: The password of the Nextcloud database user
-dbPassword="MeInPasSw0rT"
+dbPassword="mYpAsSw0rd"
# TODO: Your webserver user
webserverUser="www-data"
mysql -h localhost -u "${dbUser}" -p"${dbPassword}" "${nextcloudDatabase}" < "${currentRestoreDir}/${fileNameBackupDb}"
echo "Done"
+#
+# Start webserver
+#
+echo "Starting nginx..."
+service nginx start
+echo "Done"
+
#
# Set directory permissions
#
echo "Done"
#
-# Start webserver
+# Update the system data-fingerprint (see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/occ_command.html#maintenance-commands-label)
#
-echo "Starting nginx..."
-service nginx start
+echo "Updating the system data-fingerprint..."
+cd "${nextcloudFileDir}"
+sudo -u "${webserverUser}" php occ maintenance:data-fingerprint
+cd ~
echo "Done"
+
#
# Restore hardened directory permissions
#
cd ~
echo "Done"
-#
-# Update the system data-fingerprint (see https://docs.nextcloud.com/server/12/admin_manual/configuration_server/occ_command.html#maintenance-commands-label)
-#
-echo "Updating the system data-fingerprint..."
-cd "${nextcloudFileDir}"
-sudo -u "${webserverUser}" php occ maintenance:data-fingerprint
-cd ~
-echo "Done"
-
echo "DONE!"
-echo "Backup ${restore} successfully restored."
\ No newline at end of file
+echo "Backup ${restore} successfully restored."