mirror of
https://github.com/nextcloud/vm.git
synced 2025-10-26 11:27:32 +00:00
50 lines
1.2 KiB
Bash
50 lines
1.2 KiB
Bash
#!/bin/bash
|
|
|
|
# T&M Hansson IT AB © - 2018, https://www.hanssonit.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'
|
|
|
|
printf "Creating possible missing Directories\n"
|
|
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
|
|
|
|
printf "chown Directories\n"
|
|
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/
|
|
|
|
chmod +x ${NCPATH}/occ
|
|
|
|
printf "chmod/chown .htaccess\n"
|
|
if [ -f ${NCPATH}/.htaccess ]
|
|
then
|
|
chmod 0644 ${NCPATH}/.htaccess
|
|
chown ${rootuser}:${htgroup} ${NCPATH}/.htaccess
|
|
fi
|
|
if [ -f ${NCDATA}/.htaccess ]
|
|
then
|
|
chmod 0644 ${NCDATA}/.htaccess
|
|
chown ${rootuser}:${htgroup} ${NCDATA}/.htaccess
|
|
fi
|