paul@4 | 1 | #!/bin/sh |
paul@4 | 2 | |
paul@4 | 3 | WIKI=$1 |
paul@4 | 4 | USER=$2 |
paul@4 | 5 | |
paul@4 | 6 | if [ ! "$WIKI" ]; then |
paul@4 | 7 | echo "Please specify a Wiki directory." 1>&2 |
paul@4 | 8 | exit 1 |
paul@4 | 9 | fi |
paul@4 | 10 | |
paul@4 | 11 | if [ ! "$USER" ]; then |
paul@4 | 12 | echo "Please specify a Web username." 1>&2 |
paul@4 | 13 | exit 1 |
paul@4 | 14 | fi |
paul@4 | 15 | |
paul@4 | 16 | # Initialise and configure ACLs on the gpg "homedir". |
paul@4 | 17 | |
paul@12 | 18 | if [ ! -e "$WIKI/gnupg" ]; then |
paul@12 | 19 | mkdir $WIKI/gnupg |
paul@12 | 20 | fi |
paul@12 | 21 | |
paul@4 | 22 | chmod go-rwx $WIKI/gnupg |
paul@4 | 23 | setfacl -m u:$USER:rwx $WIKI/gnupg |
paul@4 | 24 | setfacl -m m:rwx $WIKI/gnupg |
paul@4 | 25 | setfacl -m d:u:$USER:rwx $WIKI/gnupg |
paul@5 | 26 | setfacl -m d:m:rwx $WIKI/gnupg |
paul@12 | 27 | setfacl -m m:rw $WIKI/gnupg/* |