-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathfix-permissions
executable file
·51 lines (43 loc) · 1.09 KB
/
fix-permissions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# fix permissions to run the SWI-Prolog website as www-data, group www-data
groupshared()
{ chgrp -R www-data .
find . -type d | xargs chmod 2775
find refs -type f | xargs chmod 664
git config core.sharedRepository group
}
fixwiki()
{ git config user.email "wiki@swi-prolog.org"
git config user.name "Wiki manager"
chgrp -R www-data .
find . -name '*.txt' | xargs chmod 664
find . -type d | xargs chmod 2775
(cd `git rev-parse --git-dir` && groupshared)
}
fixexamples()
{ ( cd examples
chgrp -R www-data .
find . -type f | xargs chmod 664
find . -type d | xargs chmod 2775
(cd `git rev-parse --git-dir` && groupshared)
)
}
fixblog()
{ ( cd blog
chgrp -R www-data .
find . -type f | xargs chmod 664
find . -type d | xargs chmod 2775
(cd `git rev-parse --git-dir` && groupshared)
)
}
(cd www && fixwiki)
fixexamples
fixblog
# Create and fix the logfile permissions
mkdir -p log pack
chgrp -R www-data log pack
find log -type d | xargs chmod 2775
find pack -type d | xargs chmod 2775
# Make the database writeable
chgrp www-data *.db
chmod 664 *.db