This commit is contained in:
Alexandre
2022-02-18 13:30:34 +01:00
parent 258cb25ae4
commit 3de9262724

View File

@@ -9,47 +9,47 @@ rootuser='root'
datadirectory=$(bashio::config 'data_directory') datadirectory=$(bashio::config 'data_directory')
printf "Creating possible missing Directories\n" printf "Creating possible missing Directories\n"
mkdir -p $ocpath/data mkdir -p "$ocpath"/data
mkdir -p $ocpath/assets mkdir -p "$ocpath"/assets
mkdir -p $ocpath/updater mkdir -p "$ocpath"/updater
mkdir -p $ocpath/apps mkdir -p "$ocpath"/apps
mkdir -p $ocpath/assets mkdir -p "$ocpath"/assets
mkdir -p $ocpath/config mkdir -p "$ocpath"/config
mkdir -p $ocpath/data mkdir -p "$ocpath"/data
mkdir -p $ocpath/themes mkdir -p "$ocpath"/themes
mkdir -p /data/config/nextcloud/config mkdir -p /data/config/nextcloud/config
mkdir -p /data/config/nextcloud/data mkdir -p /data/config/nextcloud/data
mkdir -p /data/config/www/nextcloud/occ 2>/dev/null mkdir -p /data/config/www/nextcloud/occ 2>/dev/null
mkdir -p $datadirectory mkdir -p "$datadirectory"
mkdir -p /ssl/nextcloud/keys mkdir -p /ssl/nextcloud/keys
printf "chmod Files and Directories. This could take some time, please wait...\n" printf "chmod Files and Directories. This could take some time, please wait...\n"
#chmod -R 777 ${ocpath} #chmod -R 777 "${ocpath}"
find ${ocpath}/ -type f -exec chmod 0640 {} \; find "${ocpath}"/ -type f -exec chmod 0640 {} \;
find ${ocpath}/ -type d -exec chmod 0750 {} \; find "${ocpath}"/ -type d -exec chmod 0750 {} \;
#find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640 #find "${ocpath}"/ -type f -print0 | xargs -0 chmod 0640
#find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750 #find "${ocpath}"/ -type d -print0 | xargs -0 chmod 0750
printf "chown Directories. This could take some time, please wait...\n" printf "chown Directories. This could take some time, please wait...\n"
chown -R ${rootuser}:${htgroup} ${ocpath}/ chown -R ${rootuser}:${htgroup} "${ocpath}"/
chown -R ${htuser}:${htgroup} ${ocpath}/apps/ chown -R ${htuser}:${htgroup} "${ocpath}"/apps/
chown -R ${htuser}:${htgroup} ${ocpath}/assets/ chown -R ${htuser}:${htgroup} "${ocpath}"/assets/
chown -R ${htuser}:${htgroup} ${ocpath}/config/ chown -R ${htuser}:${htgroup} "${ocpath}"/config/
chown -R ${htuser}:${htgroup} ${ocpath}/data/ chown -R ${htuser}:${htgroup} "${ocpath}"/data/
chown -R ${htuser}:${htgroup} ${ocpath}/themes/ chown -R ${htuser}:${htgroup} "${ocpath}"/themes/
chown -R ${htuser}:${htgroup} ${ocpath}/updater/ chown -R ${htuser}:${htgroup} "${ocpath}"/updater/
chown -R ${htuser}:${htgroup} ${datadirectory} chown -R ${htuser}:${htgroup} "${datadirectory}"
chown -R ${htuser}:${htgroup} /ssl/nextcloud/keys || true chown -R ${htuser}:${htgroup} /ssl/nextcloud/keys || true
chmod +x ${ocpath}/occ chmod +x "${ocpath}"/occ
printf "chmod/chown .htaccess\n" printf "chmod/chown .htaccess\n"
if [ -f ${ocpath}/.htaccess ]; then if [ -f "${ocpath}"/.htaccess ]; then
chmod 0644 ${ocpath}/.htaccess chmod 0644 "${ocpath}"/.htaccess
chown ${rootuser}:${htgroup} ${ocpath}/.htaccess chown "${rootuser}":"${htgroup}" "${ocpath}"/.htaccess
fi fi
if [ -f ${ocpath}/data/.htaccess ]; then if [ -f "${ocpath}"/data/.htaccess ]; then
chmod 0644 ${ocpath}/data/.htaccess chmod 0644 "${ocpath}"/data/.htaccess
chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess chown "${rootuser}":"${htgroup}" "${ocpath}"/data/.htaccess
fi fi