* fix DIRS_MODE - add execute bit for other users

This commit is contained in:
2023-09-08 09:09:48 +03:00
parent 15a30eaa78
commit 2c9b6efedc

View File

@ -14,6 +14,8 @@ WP_CONTENT_DIRS=(
) )
export WEB_GID=33 export WEB_GID=33
export DIRS_MODE=775
export FILES_MODE=664
echo -n "Check sudo permissions... " echo -n "Check sudo permissions... "
@ -48,18 +50,18 @@ perms() {
# echo "Fixing permissions for dirs" # echo "Fixing permissions for dirs"
# shellcheck disable=SC2038 # shellcheck disable=SC2038
# shellcheck disable=SC2016 # shellcheck disable=SC2016
find $TMP_DIR/ -maxdepth 1 -type f -name "dirs-without-spaces-part-*" | xargs -I {} bash -c 'chmod 774 `cat {}`' find $TMP_DIR/ -maxdepth 1 -type f -name "dirs-without-spaces-part-*" | xargs -I {} bash -c "chmod $DIRS_MODE `cat {}`"
# echo "Fixing permissions for files" # echo "Fixing permissions for files"
# shellcheck disable=SC2038 # shellcheck disable=SC2038
# shellcheck disable=SC2016 # shellcheck disable=SC2016
find $TMP_DIR/ -maxdepth 1 -type f -name "files-without-spaces-part-*" | xargs -I {} bash -c 'chmod 664 `cat {}`' find $TMP_DIR/ -maxdepth 1 -type f -name "files-without-spaces-part-*" | xargs -I {} bash -c "chmod $FILES_MODE `cat {}`"
# echo "Fixing permissions for dirs with spaces" # echo "Fixing permissions for dirs with spaces"
cat $TMP_DIR/dirs-with-spaces | xargs -I {} chmod 775 "{}" cat $TMP_DIR/dirs-with-spaces | xargs -I {} chmod $DIRS_MODE "{}"
# echo "Fixing permissions for files with spaces" # echo "Fixing permissions for files with spaces"
cat $TMP_DIR/files-with-spaces | xargs -I {} chmod 664 "{}" cat $TMP_DIR/files-with-spaces | xargs -I {} chmod $FILES_MODE "{}"
# echo "Removing temporary files" # echo "Removing temporary files"
rm $TMP_DIR/files-* rm $TMP_DIR/files-*
@ -68,7 +70,7 @@ perms() {
else else
echo -n "and fixing permission for this file... " echo -n "and fixing permission for this file... "
# echo "Fixing permissions" # echo "Fixing permissions"
chmod 664 "${TARGET}" chmod $FILES_MODE "${TARGET}"
echo "ok" echo "ok"
fi fi
} }