nextcloud-setperms.sh 516 B

123456789101112131415161718
  1. #!/bin/bash
  2. ncpath='/var/www/html'
  3. htuser='www-data'
  4. htgroup='www-data'
  5. rootuser='root'
  6. printf "chmod Files and Directories\n"
  7. find ${ncpath}/ -type f -print0 | xargs -0 chmod 0640
  8. find ${ncpath}/ -type d -print0 | xargs -0 chmod 0750
  9. chmod +x ${ncpath}/occ
  10. printf "chown Files and Directories\n"
  11. chown -R ${htuser}:${htgroup} ${ncpath}
  12. printf "chmod/chown .htaccess\n"
  13. find ${ncpath}/ -name .htaccess -print0 | xargs -0 chmod 0644
  14. find ${ncpath}/ -name .htaccess -print0 | xargs -0 chown ${rootuser}:${htgroup}