From 811fdce80f9f9322bc093cfa76baf0c30244e2b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Paunovi=C4=87?= Date: Sat, 12 May 2018 18:58:31 +0200 Subject: [PATCH 1/3] Create v-fix-websites-permissions The function fixes chmod and ownership permissions for all websites --- bin/v-fix-websites-permissions | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 bin/v-fix-websites-permissions diff --git a/bin/v-fix-websites-permissions b/bin/v-fix-websites-permissions new file mode 100644 index 000000000..c5497d4c1 --- /dev/null +++ b/bin/v-fix-websites-permissions @@ -0,0 +1,18 @@ +#!/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 {}; + +echo "All Done." + +done From 01433301f66a885d1a4baa3048646190f060f4a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Paunovi=C4=87?= Date: Sat, 12 May 2018 18:59:42 +0200 Subject: [PATCH 2/3] Update v-fix-websites-permissions --- bin/v-fix-websites-permissions | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/v-fix-websites-permissions b/bin/v-fix-websites-permissions index c5497d4c1..efc75aedf 100644 --- a/bin/v-fix-websites-permissions +++ b/bin/v-fix-websites-permissions @@ -13,6 +13,5 @@ find /home/$i/web/ -name 'public_html' -type d -print0 | xargs -0 -I {} find '{} 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 {}; -echo "All Done." - done +echo "All Done." From 666c068dcca2df2bd10a74a884a821c1f475e3ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Paunovi=C4=87?= Date: Sat, 12 May 2018 19:04:25 +0200 Subject: [PATCH 3/3] Update v-fix-websites-permissions --- bin/v-fix-websites-permissions | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/v-fix-websites-permissions b/bin/v-fix-websites-permissions index efc75aedf..c2570d368 100644 --- a/bin/v-fix-websites-permissions +++ b/bin/v-fix-websites-permissions @@ -7,11 +7,11 @@ #!/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 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 {}; +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."