summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xuser-init18
1 files changed, 14 insertions, 4 deletions
diff --git a/user-init b/user-init
index 116241f..118b26d 100755
--- a/user-init
+++ b/user-init
@@ -175,6 +175,7 @@ for user in $USERS; do
mac)
dirs_group_rw_create='.AppleDB/.AppleDesktop/Temporary Items/TheFindByContentFolder'
dirs_group_ro_create='TheVolumeSettingsFolder'
+ dirs_group_ro_update='.AppleDouble'
files_group_ro_update=':2eDS_Store'
dirs_no_access_purge='Network Trash Folder'
;;
@@ -184,7 +185,7 @@ for user in $USERS; do
continue
;;
esac
- exceptions="$dirs_group_rw_create/$dirs_group_ro_create/$files_group_ro_update/$dirs_no_access_purge"
+ exceptions="$dirs_group_rw_create/$dirs_group_ro_create/$dirs_group_ro_update/$files_group_ro_update/$dirs_no_access_purge"
exception_dirs_create="$dirs_group_rw_create/$dirs_group_ro_create"
chown "$user": "$thisdir"
chmod a=rX "$thisdir"
@@ -203,8 +204,11 @@ for user in $USERS; do
ifs="$IFS"
# Set default permissions
find "$thisdir" -mindepth 1 -maxdepth 1 -print | (while read thisdir; do
- IFS="/"; for dir in $exceptions; do IFS="$ifs";
- continue 2
+ item="`basename \"$thisdir\"`"
+ IFS="/"; for exception in $exceptions; do IFS="$ifs";
+ if [ "$item" = "$exception" ]; then
+ continue 2
+ fi
done
chgrp -R "$rwgroup" "$thisdir"
chmod -R ug=rw,o=r,a+X,g+s "$thisdir"
@@ -225,9 +229,15 @@ for user in $USERS; do
IFS="/"; for dir in $dirs_group_ro_create; do IFS="$ifs";
chmod -R u=rw,go=r,a+X,g+s "$thisdir/$dir"
done
+ # Handle exception dirs to be updated if already there
+ IFS="/"; for dir in $dirs_group_ro_update; do IFS="$ifs";
+ if [ -e "$thisdir/$dir" ]; then
+ chmod u=rw,go=r,a+X,g+s "$thisdir/$dir"
+ fi
+ done
# Handle exception files to be updated if already there
IFS="/"; for file in $files_group_ro_update; do IFS="$ifs";
- if [ -f "$thisdir/$file" ]; then
+ if [ -e "$thisdir/$file" ]; then
chmod u=rw,go=r,g+s "$thisdir/$file"
fi
done