blob: b62046a0f81e48325b088a4e487726f886452add (
plain)
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
|
pre_install() {
if [ -f /opt/capanalysis/cfg/canalysis.cfg ]; then
cp /opt/capanalysis/cfg/canalysis.cfg /opt/capanalysis/cfg/canalysis.cfg.backup
fi
}
post_install() {
if [ -f /opt/capanalysis/cfg/canalysis.cfg.backup ]; then
# upgrade DB
mv /opt/capanalysis/cfg/canalysis.cfg /opt/capanalysis/cfg/canalysis.cfg.last
cp /opt/capanalysis/cfg/canalysis.cfg.backup /opt/capanalysis/cfg/canalysis.cfg
fi
chown -R http:http /opt/capanalysis
echo "Rember to paste this line"
echo " # Capanalysis"
echo " Include conf/extra/httpd-capana.conf"
echo "in /etc/httpd/conf/httpd.conf"
echo "Uncomment sqlite, pdo_pgsql and gettext in /etc/php/php.ini"
echo "Uncomment mod_rewrite in /etc/httpd/conf/httpd.conf"
}
post_remove(){
if [ -d /opt/capanalysis ]; then
if [ -d /opt/capanalysis/www/app/tmp/cache ]; then
rm -rf /opt/capanalysis/www/app/tmp/cache/models/*
rm -rf /opt/capanalysis/www/app/tmp/cache/views/*
rm -rf /opt/capanalysis/www/app/tmp/sessions/*
rm -rf /opt/capanalysis/www/app/tmp/logs/*
fi
echo 'drop database capanalysis;' > /tmp/dbrm
echo 'drop user capana;' >> /tmp/dbrm
sudo -u postgres psql -f /tmp/dbrm
rm -f /tmp/dbrm
fi
echo "Don't forget to:"
echo " restore php.ini and httpd.conf files"
echo " delete capanalysis folder"
}
|