From 3de92627244545019d37a6a92b0462526a0c4c55 Mon Sep 17 00:00:00 2001 From: Alexandre Date: Fri, 18 Feb 2022 13:30:34 +0100 Subject: [PATCH] lint --- nextcloud/rootfs/defaults/nextcloud-perms.sh | 58 ++++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/nextcloud/rootfs/defaults/nextcloud-perms.sh b/nextcloud/rootfs/defaults/nextcloud-perms.sh index 1c4fa0ece..83b9f6548 100644 --- a/nextcloud/rootfs/defaults/nextcloud-perms.sh +++ b/nextcloud/rootfs/defaults/nextcloud-perms.sh @@ -9,47 +9,47 @@ rootuser='root' datadirectory=$(bashio::config 'data_directory') printf "Creating possible missing Directories\n" -mkdir -p $ocpath/data -mkdir -p $ocpath/assets -mkdir -p $ocpath/updater -mkdir -p $ocpath/apps -mkdir -p $ocpath/assets -mkdir -p $ocpath/config -mkdir -p $ocpath/data -mkdir -p $ocpath/themes +mkdir -p "$ocpath"/data +mkdir -p "$ocpath"/assets +mkdir -p "$ocpath"/updater +mkdir -p "$ocpath"/apps +mkdir -p "$ocpath"/assets +mkdir -p "$ocpath"/config +mkdir -p "$ocpath"/data +mkdir -p "$ocpath"/themes mkdir -p /data/config/nextcloud/config mkdir -p /data/config/nextcloud/data mkdir -p /data/config/www/nextcloud/occ 2>/dev/null -mkdir -p $datadirectory +mkdir -p "$datadirectory" mkdir -p /ssl/nextcloud/keys printf "chmod Files and Directories. This could take some time, please wait...\n" -#chmod -R 777 ${ocpath} -find ${ocpath}/ -type f -exec chmod 0640 {} \; -find ${ocpath}/ -type d -exec chmod 0750 {} \; +#chmod -R 777 "${ocpath}" +find "${ocpath}"/ -type f -exec chmod 0640 {} \; +find "${ocpath}"/ -type d -exec chmod 0750 {} \; -#find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640 -#find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750 +#find "${ocpath}"/ -type f -print0 | xargs -0 chmod 0640 +#find "${ocpath}"/ -type d -print0 | xargs -0 chmod 0750 printf "chown Directories. This could take some time, please wait...\n" -chown -R ${rootuser}:${htgroup} ${ocpath}/ -chown -R ${htuser}:${htgroup} ${ocpath}/apps/ -chown -R ${htuser}:${htgroup} ${ocpath}/assets/ -chown -R ${htuser}:${htgroup} ${ocpath}/config/ -chown -R ${htuser}:${htgroup} ${ocpath}/data/ -chown -R ${htuser}:${htgroup} ${ocpath}/themes/ -chown -R ${htuser}:${htgroup} ${ocpath}/updater/ -chown -R ${htuser}:${htgroup} ${datadirectory} +chown -R ${rootuser}:${htgroup} "${ocpath}"/ +chown -R ${htuser}:${htgroup} "${ocpath}"/apps/ +chown -R ${htuser}:${htgroup} "${ocpath}"/assets/ +chown -R ${htuser}:${htgroup} "${ocpath}"/config/ +chown -R ${htuser}:${htgroup} "${ocpath}"/data/ +chown -R ${htuser}:${htgroup} "${ocpath}"/themes/ +chown -R ${htuser}:${htgroup} "${ocpath}"/updater/ +chown -R ${htuser}:${htgroup} "${datadirectory}" chown -R ${htuser}:${htgroup} /ssl/nextcloud/keys || true -chmod +x ${ocpath}/occ +chmod +x "${ocpath}"/occ printf "chmod/chown .htaccess\n" -if [ -f ${ocpath}/.htaccess ]; then - chmod 0644 ${ocpath}/.htaccess - chown ${rootuser}:${htgroup} ${ocpath}/.htaccess +if [ -f "${ocpath}"/.htaccess ]; then + chmod 0644 "${ocpath}"/.htaccess + chown "${rootuser}":"${htgroup}" "${ocpath}"/.htaccess fi -if [ -f ${ocpath}/data/.htaccess ]; then - chmod 0644 ${ocpath}/data/.htaccess - chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess +if [ -f "${ocpath}"/data/.htaccess ]; then + chmod 0644 "${ocpath}"/data/.htaccess + chown "${rootuser}":"${htgroup}" "${ocpath}"/data/.htaccess fi