r2:
[clamav-cn.git] / debian / postinst
1 #!/bin/sh
2
3 set -e
4
5 [ "$1" = "configure" ] || exit 0
6
7 # Load CARNet functions
8 #. /usr/share/carnet-tools/functions.sh
9
10 #if dpkg --compare-versions "$2" lt 2:0.91.1-1 ; then
11 #  cp_backup_conffile /etc/clamav/clamd.conf
12 #  rm -f /etc/clamav/clamd.conf
13 #  cp -a /usr/share/doc/clamav-cn/examples/clamd.conf /etc/clamav/clamd.conf
14 #  restart="yes"
15 #fi
16 #
17 #if dpkg --compare-versions "$2" lt 2:0.91.1-1 ; then
18 #  cp_backup_conffile /etc/clamav/freshclam.conf
19 #  rm -f /etc/clamav/freshclam.conf
20 #  cp -a /usr/share/doc/clamav-cn/examples/freshclam.conf /etc/clamav/freshclam.conf
21 #  restart="yes"
22 #fi
23
24 chown -R clamav:clamav /var/run/clamav /var/lib/clamav /var/log/clamav
25
26 # dodaj korisnika clamav u grupu amavis (ako postoji...)
27 getent group amavis > /dev/null && usermod -G amavis clamav && restart="yes"
28
29 # restart if needed
30 [ "$restart" = "yes" ] || exit 0
31 if [ -x /usr/sbin/invoke-rc.d ]; then
32   [ -x /etc/init.d/clamav-daemon ] && invoke-rc.d clamav-daemon restart
33 else
34   [ -x /etc/init.d/clamav-daemon ] && /etc/init.d/clamav-daemon restart
35 fi
36
37 if [ -x /usr/sbin/invoke-rc.d ]; then
38   [ -x /etc/init.d/clamav-freshclam ] && invoke-rc.d clamav-freshclam restart
39 else
40   [ -x /etc/init.d/clamav-freshclam ] && /etc/init.d/clamav-freshclam restart
41 fi