-
open a terminal
-
enter this code (check NC_DIR and HT_USER carefully beforehand):
HT_USER=www-data # change this if your ht user is different
NC_DIR=/var/www/sub-domains/me.wensley.nextcloud/html
nc_download_default() { local app_id=$1 file=$2 version_tag path=$2
case "$app_id" in
server) version_tag="v$(awk -F\' '/String/{gsub(/ /,"");$2=tolower($2);print $2}' "$NC_DIR/version.php")" ;;
*) xml_f="$NC_DIR/apps/$app_id/appinfo/info.xml"
version_tag="v$(xmlstarlet sel -B -t -v "//info/version" "$xml_f"|sed '2,$d')"
path="apps/$app_id/$file"
esac
sudo -u $HT_USER curl -so $NC_DIR/$path https://raw.githubusercontent.com/nextcloud/$app_id/$version_tag/$file
}
for missing_file in '.htaccess' '.user.ini'; do nc_download_default server "$missing_file"; done
sudo -u $HT_USER php $NC_DIR/occ integrity:check-core
Then you will have the correct files for your version on the right place.
You can use this function always for missing files (eg. adding it in your ~/.bash_aliases) but if you want to use it for apps (not the server core), you need xmlstarlet
Much and good luck,
ernolf