This commit is contained in:
Luka Paunović 2024-04-19 14:58:42 +08:00 committed by GitHub
commit a7c066b69d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,17 @@
#!/bin/bash
# info: CHMOD & Ownership FIX
# options: NO OPTIONS
#
# The function fixes chmod and ownership permissions for all websites
#!/bin/bash
for i in `$VESTA/bin/v-list-sys-users | awk '{if(NR>2)print}'`; do
find /home/$i/web/ -name 'public_*html' -type d -print0 | xargs -0 -I {} find '{}' -type f -print0 | xargs -0 -I {} chmod 0644 {};
find /home/$i/web/ -name 'public_*html' -type d -print0 | xargs -0 -I {} find '{}' -type f -print0 | xargs -0 -I {} chown $i:$i {};
find /home/$i/web/ -name 'public_*html' -type d -print0 | xargs -0 -I {} find '{}' -type d -print0 | xargs -0 -I {} chmod 0755 {};
find /home/$i/web/ -name 'public_*html' -type d -print0 | xargs -0 -I {} find '{}' -type d -print0 | xargs -0 -I {} chown $i:$i {};
done
echo "All Done."