diff options
author | Daniel Hansson <daniel@techandme.se> | 2017-04-09 23:43:30 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-09 23:43:30 +0300 |
commit | ab649db479a05da1589a2158f446eda699480c37 (patch) | |
tree | 3b88db4f4a2d5487db1f0edf3f5e14b165ede498 /static/setup_secure_permissions_nextcloud.sh | |
parent | 05001d9d2fe479f7a3f8fabdfb47f172c8b183e6 (diff) |
Rewrite is now done! (#196)
Diffstat (limited to 'static/setup_secure_permissions_nextcloud.sh')
-rw-r--r-- | static/setup_secure_permissions_nextcloud.sh | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/static/setup_secure_permissions_nextcloud.sh b/static/setup_secure_permissions_nextcloud.sh index b2545c01..451df76e 100644 --- a/static/setup_secure_permissions_nextcloud.sh +++ b/static/setup_secure_permissions_nextcloud.sh @@ -1,34 +1,46 @@ #!/bin/bash -ncpath='/var/www/nextcloud' + +# Tech and Me © - 2017, https://www.techandme.se/ + +# shellcheck disable=2034,2059 +true +# shellcheck source=lib.sh +. <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh) + +# Check for errors + debug code and abort if something isn't right +# 1 = ON +# 0 = OFF +DEBUG=0 +debug_mode + htuser='www-data' htgroup='www-data' rootuser='root' -NCDATA='/var/ncdata' printf "Creating possible missing Directories\n" -mkdir -p $ncpath/data -mkdir -p $ncpath/updater +mkdir -p $NCPATH/data +mkdir -p $NCPATH/updater mkdir -p $NCDATA printf "chmod Files and Directories\n" -find ${ncpath}/ -type f -print0 | xargs -0 chmod 0640 -find ${ncpath}/ -type d -print0 | xargs -0 chmod 0750 +find ${NCPATH}/ -type f -print0 | xargs -0 chmod 0640 +find ${NCPATH}/ -type d -print0 | xargs -0 chmod 0750 printf "chown Directories\n" -chown -R ${rootuser}:${htgroup} ${ncpath}/ -chown -R ${htuser}:${htgroup} ${ncpath}/apps/ -chown -R ${htuser}:${htgroup} ${ncpath}/config/ +chown -R ${rootuser}:${htgroup} ${NCPATH}/ +chown -R ${htuser}:${htgroup} ${NCPATH}/apps/ +chown -R ${htuser}:${htgroup} ${NCPATH}/config/ chown -R ${htuser}:${htgroup} ${NCDATA}/ -chown -R ${htuser}:${htgroup} ${ncpath}/themes/ -chown -R ${htuser}:${htgroup} ${ncpath}/updater/ +chown -R ${htuser}:${htgroup} ${NCPATH}/themes/ +chown -R ${htuser}:${htgroup} ${NCPATH}/updater/ -chmod +x ${ncpath}/occ +chmod +x ${NCPATH}/occ printf "chmod/chown .htaccess\n" -if [ -f ${ncpath}/.htaccess ] +if [ -f ${NCPATH}/.htaccess ] then - chmod 0644 ${ncpath}/.htaccess - chown ${rootuser}:${htgroup} ${ncpath}/.htaccess + chmod 0644 ${NCPATH}/.htaccess + chown ${rootuser}:${htgroup} ${NCPATH}/.htaccess fi if [ -f ${NCDATA}/.htaccess ] then |