b624e387 |
1 | #!/bin/bash |
2 | # |
3 | # moinmoin-install: Install a MoinMoin instance to a particular |
4 | # directory, setting AFS permissions properly. |
5 | # |
6 | # Usage: moinmoin-install directory |
7 | |
8 | function usage() { |
9 | echo "Usage: moinmoin-install directory" |
10 | } |
11 | |
12 | if test -n "$2"; then |
13 | echo "Too many arguments" |
14 | usage |
15 | exit 1 |
16 | elif test -z "$1"; then |
17 | echo "Not enough arguments" |
18 | usage |
19 | exit 1 |
20 | else |
21 | DIR=$1 |
22 | fi |
23 | |
24 | echo "Copying files ..." |
25 | mkdir -p "$DIR" |
26 | cp -r /usr/share/moin/data "$DIR" |
27 | cp -r /usr/share/moin/underlay "$DIR" |
28 | cp /usr/share/moin/server/moin.cgi "$DIR" |
29 | cp /usr/share/moin/config/wikiconfig.py "$DIR" |
30 | echo |
31 | |
32 | echo "Setting ACLs ..." |
33 | fs setacl "$DIR" $USER.daemon read |
34 | fsr setacl "$DIR"/data $USER.daemon write |
35 | fsr setacl "$DIR"/underlay $USER.daemon write |
36 | echo |
37 | |
38 | echo "MoinMoin instance successfully created at directory $DIR" |
39 | echo "Don't forget to edit $DIR/wikiconfig.py" |