-
Notifications
You must be signed in to change notification settings - Fork 0
/
clearCache.sh
70 lines (49 loc) · 1.44 KB
/
clearCache.sh
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env bash
#useage: ./bin/clearCache.sh --css --sessions --logs
echo "Start clearing cache"
while [ "$1" != '' ]
do
[ "$1" == "--css" ] && CSS="yes" && shift
[ "$1" == "--sessions" ] && SESSIONS="yes" && shift
[ "$1" == "--logs" ] && LOGS="yes" && shift
shift #unknown
done
dir=$(cd -P -- "$(dirname -- "$0")/.." && pwd -P)
echo "Clear Regular Cache"
rm -rf $dir/cache/*.php
rm -rf $dir/cache/*.pdc
rm -rf $dir/cache/execute_post_installation_admin_extenders
rm -rf $dir/cache/hub_*
rm -rf $dir/cache/banner_infobox--*.png
if [ "$CSS" == "yes" ]
then
echo "Clear CSS cache"
rm -f $dir/cache/*.css
rm -f $dir/cache/*.css.*
rm -f $dir/templates/Honeygrid/assets/javascript/init-de.min.js
fi
if [ "$SESSIONS" == "yes" ]
then
echo "Clear SESSIONS cache"
rm -f $dir/cache/sess_*
fi
if [ "$LOGS" == "yes" ]
then
echo "Clear LOGS"
rm -f $dir/logfiles/errors-*.html
rm -f $dir/logfiles/errors-*.log
fi
echo "Clear TEMPLATE Cache"
rm -rf $dir/templates_c/*
echo "Refresh RIGHTS"
chmod -R 777 $dir/cache
chmod -R 777 $dir/templates_c
chmod -R 777 $dir/templates
chmod -R 777 $dir/StyleEdit3/templates
chmod -R 777 $dir/images
chmod -R 777 $dir/uploads
chmod 444 $dir/admin/includes/configure.php
chmod 444 $dir/admin/includes/configure.org.php
chmod 444 $dir/includes/configure.php
chmod 444 $dir/includes/configure.org.php
echo "End clearing cache"