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