diff --git a/src/freedombone-app-nextcloud b/src/freedombone-app-nextcloud index 40e1fec6..4fa51ee1 100755 --- a/src/freedombone-app-nextcloud +++ b/src/freedombone-app-nextcloud @@ -183,16 +183,20 @@ function configure_interactive_nextcloud { echo -n '' } +function upgrade_nextcloud_base { + chown -R www-data:www-data /var/www/$NEXTCLOUD_DOMAIN_NAME/htdocs + chown -R www-data:www-data /var/www/$NEXTCLOUD_DOMAIN_NAME/data + cd /var/www/$NEXTCLOUD_DOMAIN_NAME/htdocs + sudo -u www-data ./occ maintenance:repair + sudo -u www-data ./occ files:cleanup + sudo -u www-data ./occ files:scan --all + sudo -u www-data ./occ maintenance:mode --off +} + function upgrade_nextcloud { CURR_NEXTCLOUD_COMMIT=$(get_completion_param "nextcloud commit") if [[ "$CURR_NEXTCLOUD_COMMIT" == "$NEXTCLOUD_COMMIT" ]]; then - chown -R www-data:www-data /var/www/$NEXTCLOUD_DOMAIN_NAME/htdocs - chown -R www-data:www-data /var/www/$NEXTCLOUD_DOMAIN_NAME/data - cd /var/www/$NEXTCLOUD_DOMAIN_NAME/htdocs - sudo -u www-data ./occ maintenance:repair - sudo -u www-data ./occ files:cleanup - sudo -u www-data ./occ files:scan --all - sudo -u www-data ./occ maintenance:mode --off + upgrade_nextcloud_base return fi @@ -204,13 +208,7 @@ function upgrade_nextcloud { function_check set_repo_commit set_repo_commit /var/www/$NEXTCLOUD_DOMAIN_NAME/htdocs "nextcloud commit" "$NEXTCLOUD_COMMIT" $NEXTCLOUD_REPO - chown -R www-data:www-data /var/www/$NEXTCLOUD_DOMAIN_NAME/htdocs - chown -R www-data:www-data /var/www/$NEXTCLOUD_DOMAIN_NAME/data - cd /var/www/$NEXTCLOUD_DOMAIN_NAME/htdocs - sudo -u www-data ./occ maintenance:repair - sudo -u www-data ./occ files:cleanup - sudo -u www-data ./occ files:scan --all - sudo -u www-data ./occ maintenance:mode --off + upgrade_nextcloud_base }