diff options
-rwxr-xr-x | user-init | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -309,31 +309,36 @@ for user in $USERS; do esac exceptions="$dirs_world_rw_create/$dirs_group_rw_create/$dirs_group_ro_create/$dirs_group_ro_update/$files_group_ro_update/$dirs_no_access_purge" exception_dirs_create="$dirs_world_rw_create/$dirs_group_rw_create/$dirs_group_ro_create" + # <home>/shares.<sharetype> chown "$user": "$thisdir" chmod a=rX "$thisdir" find "$thisdir" -mindepth 1 -maxdepth 1 -type d -print | (while read thisdir; do + # <home>/shares.<sharetype>/<rogroup> rogroup="`basename \"$thisdir\"`" chown "$user":"$rogroup" "$thisdir" chmod ug=rX,o= "$thisdir" find "$thisdir" -mindepth 1 -maxdepth 1 -type d -print | (while read thisdir; do + # <home>/shares.<sharetype>/<rogroup>/<rwgroup> rwgroup="`basename \"$thisdir\"`" chown "$user":"$rwgroup" "$thisdir" chmod a=rX,g+s "$thisdir" find "$thisdir" -mindepth 1 -maxdepth 1 -type d -print | (while read thisdir; do + # <home>/shares.<sharetype>/<rogroup>/<rwgroup>/<sharename> sharename="`basename \"$thisdir\"`" chown "$user":"$rwgroup" "$thisdir" chmod u=rw,go=r,a+X,g+s "$thisdir" ifs="$IFS" # Set default permissions - find "$thisdir" -mindepth 1 -maxdepth 1 -print | (while read thisdir; do - item="`basename \"$thisdir\"`" + find "$thisdir" -mindepth 1 -maxdepth 1 -print | (while read thisitem; do + # <home>/shares.<sharetype>/<rogroup>/<rwgroup>/<sharename>/* + thisparentdir="`basename \"$thisitem\"`" IFS="/"; for exception in $exceptions; do IFS="$ifs"; - if [ "$item" = "$exception" ]; then + if [ "$thisparentdir" = "$exception" ]; then continue 2 fi done - chgrp -R "$rwgroup" "$thisdir" - chmod -R ug=rw,o=r,a+X,g+s "$thisdir" + chgrp -R "$rwgroup" "$thisitem" + chmod -R ug=rw,o=r,a+X,g+s "$thisitem" done) # Handle exception dirs to be created if not existing IFS="/"; for dir in $exception_dirs_create; do IFS="$ifs"; |