izmjene za lintian
[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 cp_check_and_sed "^AllowSupplementaryGroups false" \
12                  "s/AllowSupplementaryGroups false/AllowSupplementaryGroups true/g" \
13                  /etc/clamav/clamd.conf && restart="yes" || true
14
15 if ! grep -q ^AllowSupplementaryGroups /etc/clamav/clamd.conf; then
16   echo "AllowSupplementaryGroups true" >> /etc/clamav/clamd.conf
17   reload="yes"
18 fi
19
20 chown -R clamav:clamav /var/run/clamav /var/lib/clamav /var/log/clamav
21
22 # dodaj korisnika clamav u grupu amavis (ako postoji...)
23 getent group amavis > /dev/null && usermod -G amavis clamav && restart="yes"
24
25 # ispravi opciju od clamscana u amavis konfi
26 # --disable-summary -> --no-summary
27 if [ -f /etc/amavis/conf.d/15-av_scanners ]; then
28   cp_check_and_sed "\-\-disable-summary" \
29                    "s/--disable-summary/--no-summary/g" \
30                    /etc/amavis/conf.d/15-av_scanners && restart_amavis="yes" || true
31
32   if [ -f /etc/amavis/conf.d/15-av_scanners.cn-old ]; then
33     rm -f /etc/amavis/conf.d/15-av_scanners.cn-old
34   fi
35 fi
36
37 # izbaciti MSRBL
38 if ! grep -q "^unset msrbl_dbs" /etc/clamav-unofficial-sigs.conf; then
39   echo "unset msrbl_dbs" >> /etc/clamav-unofficial-sigs.conf
40 fi
41
42 if [ "$restart_amavis" = "yes" ]; then
43   if [ -x /usr/sbin/invoke-rc.d ]; then
44     [ -x /etc/init.d/amavisd-cn ] && invoke-rc.d amavisd-cn restart
45   else
46     [ -x /etc/init.d/amavisd-cn ] && /etc/init.d/amavisd-cn restart
47   fi
48   # nije potreban restart clamava
49   restart="no"
50 fi
51
52 # restart if needed
53 [ "$restart" = "yes" ] || exit 0
54 if [ -x /usr/sbin/invoke-rc.d ]; then
55   [ -x /etc/init.d/clamav-daemon ] && invoke-rc.d clamav-daemon restart
56 else
57   [ -x /etc/init.d/clamav-daemon ] && /etc/init.d/clamav-daemon restart
58 fi
59
60 if [ -x /usr/sbin/invoke-rc.d ]; then
61   [ -x /etc/init.d/clamav-freshclam ] && invoke-rc.d clamav-freshclam restart
62 else
63   [ -x /etc/init.d/clamav-freshclam ] && /etc/init.d/clamav-freshclam restart
64 fi
65
66 #DEBHELPER#