-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsrvreload
More file actions
executable file
·43 lines (33 loc) · 863 Bytes
/
srvreload
File metadata and controls
executable file
·43 lines (33 loc) · 863 Bytes
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
#!/bin/sh
OWNER=manu
status() {
if [ $1 = 0 ]; then
printf "OK\n"
else
printf "FAIL\n"
exit 1
fi
}
printf 'Force re-compile of Python bytecode... '
find -iname '*.py' -exec py_compilefiles -fq {} \;
status $?
printf 'Fix permissions of Python bytecode files... '
find -iname '*.pyc' -exec chown ${OWNER}:${OWNER} {} \;
status $?
printf 'Fix permissions on directories... '
find -type d -exec chmod 755 {} \;
status $?
printf 'Fix permissions on regular files... '
find -type f -exec chmod 644 {} \;
status $?
for i in manage.py srvdev "$0" ; do
printf 'Fix permissions on “%s” tool... ' "$i"
chmod a+x "$i"
status $?
done
printf 'Checking web server config... '
apache2ctl configtest >/dev/null 2>&1
status $?
printf 'Reload web server... '
apache2ctl graceful >/dev/null 2>&1
status $?