#!/bin/bash ocpath='/home/www/cloud.onetipp.com' htuser='www-data' htgroup='www-data' rootuser='root' # On QNAP this is admin find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640 find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750 chown -R ${rootuser}:${htgroup} ${ocpath}/ chown -R ${htuser}:${htgroup} ${ocpath}/apps/ chown -R ${htuser}:${htgroup} ${ocpath}/config/ chown -R ${htuser}:${htgroup} ${ocpath}/data/ chown -R ${htuser}:${htgroup} ${ocpath}/themes/ chown ${rootuser}:${htgroup} ${ocpath}/.htaccess chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess chmod 0644 ${ocpath}/.htaccess chmod 0644 ${ocpath}/data/.htaccess