diff --git a/root/etc/cont-init.d/50-config b/root/etc/cont-init.d/50-config index 27433ad..41a07c2 100644 --- a/root/etc/cont-init.d/50-config +++ b/root/etc/cont-init.d/50-config @@ -39,10 +39,10 @@ done # set queue driver to database sed -i 's/QUEUE_DRIVER=sync/QUEUE_DRIVER=database/' /config/www/.env -# function to randomly sample 50 files for their owner and only chown if not abc +# function to randomly sample 5 files for their owner and only chown if not abc chowner () { files=(${1}/*) -for i in {1..50}; do +for i in {1..5}; do user=$(stat -c '%U' $(printf "%s\n" "${files[RANDOM % ${#files[@]}]}")) if [ "${user}" != "abc" ]; then chown -R abc:abc ${1}