1 |
233
|
aaronmk
|
#!/bin/sh
|
2 |
|
|
# Sets correct permissions on shared bien files
|
3 |
|
|
|
4 |
|
|
selfDir="$(dirname -- "$0")" # dir of symlink $0, not this script itself
|
5 |
|
|
cd "$selfDir"
|
6 |
|
|
|
7 |
285
|
aaronmk
|
opts="--quiet --changes"
|
8 |
|
|
chOpts="--recursive --no-dereference $opts"
|
9 |
|
|
chown $chOpts bien .
|
10 |
|
|
chgrp $chOpts bien .
|
11 |
234
|
aaronmk
|
find . -type d -exec chmod $opts g+s "{}" \; # only dirs should be setgid
|
12 |
242
|
aaronmk
|
for perm in r w x; do # extend user perms to group
|
13 |
265
|
aaronmk
|
find . -not -type l -perm -u=$perm -exec chmod $opts g+$perm "{}" \;
|
14 |
|
|
# don't chmod symlinks
|
15 |
242
|
aaronmk
|
done
|