OLD | NEW |
| (Empty) |
1 #!/bin/bash | |
2 | |
3 anwiki_root="/var/www/adblockplus.org/anwiki" | |
4 php_root="/var/www/adblockplus.org/phproot" | |
5 | |
6 temp_dir="/tmp/anwiki-$$" | |
7 rm -rf "$temp_dir" | |
8 mkdir "$temp_dir" | |
9 cd "$temp_dir" | |
10 | |
11 local_anwiki_repository="/mnt/local_anwiki_repository" | |
12 if [[ -d $local_anwiki_repository ]]; then | |
13 cp -r "$local_anwiki_repository" anwiki | |
14 rm -r anwiki/.hg* | |
15 else | |
16 hg clone https://hg.adblockplus.org/anwiki anwiki-hg &>/dev/null | |
17 | |
18 if [[ $? != 0 ]]; then | |
19 echo "Unable to clone anwiki repository" >&2 | |
20 exit 1 | |
21 fi | |
22 | |
23 hg archive -R anwiki-hg -r local anwiki | |
24 fi | |
25 | |
26 find anwiki/anwiki -name .htaccess -exec rm '{}' \; | |
27 find anwiki/anwiki -name index.html -exec rm '{}' \; | |
28 find anwiki/anwiki/_override -name '*.cfg.php' -exec rm '{}' \; | |
29 rm anwiki/anwiki/htaccess-DISABLED | |
30 rm anwiki/anwiki/_anwiki-override-DISABLED.inc.php | |
31 | |
32 rm -rf "$anwiki_root"/{_addons,_addons-static,_override-static,default,default-s
tatic,sources} | |
33 find "$anwiki_root/_override" -type f -not -name '*.cfg.php' | | |
34 while read file; do | |
35 rm -f "$file" && rmdir -p "`dirname "$file"`" &>/dev/null | |
36 done | |
37 | |
38 mkdir -p "$anwiki_root" | |
39 mkdir -p "$php_root" | |
40 | |
41 site_dir="anwiki/anwiki" | |
42 chown -R www-data:www-data anwiki/anwiki | |
43 cp -prf "$site_dir"/{_addons,_addons-static,_override,_override-static,default,d
efault-static,sources,anwiki.inc.php} "$anwiki_root" | |
44 cp -prf "$site_dir"/{index.php,engine.inc.php} "$php_root" | |
45 | |
46 writable_dir="$anwiki_root/_writable" | |
47 | |
48 mkdir -p "$writable_dir/"{status,tmp} | |
49 | |
50 cache_dir="$writable_dir/cache" | |
51 rm -rf "$cache_dir" | |
52 mkdir -p "$cache_dir/"{config,content/bygroup,content/byid,content/byname,system
} | |
53 | |
54 chown -R www-data:www-data "$writable_dir" | |
55 | |
56 aclsdriver_configrules="$anwiki_root/_override/drivers/aclsdrivers/aclsdriver_co
nfigrules/aclsdriver_configrules.cfg.php" | |
57 touch "$aclsdriver_configrules" | |
58 chown www-data "$aclsdriver_configrules" | |
59 | |
60 rm -rf "$temp_dir" | |
OLD | NEW |