Open in CoCalc
1
#!/bin/bash
2
3
# path of MoinMoin shared files
4
SHARE=/usr/share/moin
5
6
# path to target instance location
7
INSTANCE=$1
8
9
# should be nice
10
USER=www-data
11
GROUP=www-data
12
13
if [ ! $1 ]
14
then
15
echo "You must specify an instance (relative or absolute path)"
16
exit
17
fi
18
19
if [[ -e $1 || -d $1 ]]
20
then
21
echo "$1 already exists"
22
exit
23
fi
24
25
mkdir -p $INSTANCE
26
cp -R $SHARE/data $INSTANCE
27
cp -R $SHARE/underlay $INSTANCE
28
cp $SHARE/config/wikiconfig.py $INSTANCE
29
30
chown -R $USER.$GROUP $INSTANCE
31
chmod -R ug+rwX $INSTANCE
32
chmod -R o-rwx $INSTANCE
33
34
if [ $? ]
35
then
36
echo "Done."
37
fi
38
39