Vraćanje PID-a, brisanje SafeBrowsing opcije iz freshclam.conf
[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 Tools
9 . /usr/share/carnet-tools/functions.sh
10
11 # obsolete option
12 cp_check_and_sed "^AllowSupplementaryGroups" \
13                  "s/^AllowSupplementaryGroups/#AllowSupplementaryGroups/g" \
14                  /etc/clamav/clamd.conf && restart="yes" || true
15
16 # obsolete option SafeBrowsing https://blog.clamav.net/2021/04/clamav-01032-security-patch-release.html
17 cp_check_and_sed "^SafeBrowsing" \
18                  "s/^SafeBrowsing/#SafeBrowsing/g" \
19                  /etc/clamav/freshclam.conf && restart="yes" || true
20
21 # dodaj staru opciju PidFIle kako bi monit pouzdano radio
22 cp_check_and_sed "^#PidFile" \
23                  "s,^#PidFile /var/run/clamav/clamd.pid,PidFile /var/run/clamav/clamd.pid,g" \
24                  /etc/clamav/clamd.conf && restart="yes" || true
25 # za svaki slučaj ako je neka druga putanja
26 cp_check_and_sed "^PidFile" \
27                  "s,^PidFile.*,PidFile /var/run/clamav/clamd.pid,g" \
28                  /etc/clamav/clamd.conf && restart="yes" || true
29
30 if [ -d /var/run/clamav ]; then
31   chown -R clamav:clamav /var/run/clamav
32 fi
33
34 if [ -d /run/clamav ]; then
35   chown -R clamav:clamav /run/clamav
36 fi
37
38 if [ -d /var/lib/clamav ]; then
39   chown -R clamav:clamav /var/lib/clamav
40 fi
41
42 if [ -d /var/log/clamav ]; then
43   chown -R clamav:clamav /var/log/clamav
44 fi
45
46 # dodaj korisnika clamav u grupu amavis (ako postoji...)
47 getent group amavis > /dev/null && usermod -G amavis clamav && restart="yes"
48
49 # restart if needed
50 [ "$restart" = "yes" ] || exit 0
51 service clamav-daemon restart
52 service clamav-freshclam restart
53
54 #DEBHELPER#