Created
April 21, 2018 14:28
-
-
Save lukapaunovic/6869d3e01be95ac2daa67587898a2db5 to your computer and use it in GitHub Desktop.
fix-ownership-permissions.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Chmoding user files to 0644..." | |
for i in `/usr/local/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 {}; done | |
echo "Done." | |
echo "Chmoding user folder to 0755..." | |
for i in `/usr/local/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 d -print0 | xargs -0 -I {} chmod 0755 {}; done | |
echo "Done." | |
echo "Fixing ownership of files..." | |
for i in `/usr/local/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 {} chown $i:$i {}; done | |
echo "Done." | |
echo "Fixing ownership of folders..." | |
for i in `/usr/local/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 d -print0 | xargs -0 -I {} chown $i:$i {}; done | |
echo "All Done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment