Guest User

Untitled

a guest
Feb 20th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. #!/bin/bash
  2. ncpath='/var/www/nextcloud'
  3. htuser='www-data'
  4. htgroup='www-data'
  5. rootuser='root'
  6.  
  7. printf "Creating possible missing Directories\n"
  8. mkdir -p $ncpath/data
  9. mkdir -p $ncpath/updater
  10.  
  11. printf "chmod Files and Directories\n"
  12. find ${ncpath}/ -type f -print0 | xargs -0 chmod 0640
  13. find ${ncpath}/ -type d -print0 | xargs -0 chmod 0750
  14.  
  15. printf "chown Directories\n"
  16. chown -R ${rootuser}:${htgroup} ${ncpath}
  17. chown -R ${htuser}:${htgroup} ${ncpath}/apps/
  18. chown -R ${htuser}:${htgroup} ${ncpath}/config/
  19. chown -R ${htuser}:${htgroup} ${ncpath}/data/
  20. chown -R ${htuser}:${htgroup} ${ncpath}/themes/
  21. chown -R ${htuser}:${htgroup} ${ncpath}/updater/
  22.  
  23. chmod +x ${ncpath}/occ
  24.  
  25. printf "chmod/chown .htaccess\n"
  26. if [ -f ${ncpath}/.htaccess ]
  27. then
  28. chmod 0644 ${ncpath}/.htaccess
  29. chown ${rootuser}:${htgroup} ${ncpath}/.htaccess
  30. fi
  31. if [ -f ${ncpath}/data/.htaccess ]
  32. then
  33. chmod 0644 ${ncpath}/data/.htaccess
  34. chown ${rootuser}:${htgroup} ${ncpath}/data/.htaccess
  35. fi
Add Comment
Please, Sign In to add comment