summaryrefslogtreecommitdiff
path: root/user-init
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2008-01-18 14:19:59 +0000
committerJonas Smedegaard <dr@jones.dk>2008-01-18 14:19:59 +0000
commit5dbe9f58907075034b51743637467fdcdb983e3f (patch)
treedf16b21732f73efbebabc53eda0ff5117bf0a3c5 /user-init
parent72b5be1874ae6b4bb8c3fb0143314d9a9a7b3db8 (diff)
Add comments about share subdirs processed. Change thisdir->thisitem and item->thisparentdir for share sub-sub-sub-items.
Diffstat (limited to 'user-init')
-rwxr-xr-xuser-init15
1 files changed, 10 insertions, 5 deletions
diff --git a/user-init b/user-init
index b87681f..1857534 100755
--- a/user-init
+++ b/user-init
@@ -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";