5 [ "$1" = "configure" ] || exit 0
6 [ "$DEBIAN_SCRIPT_DEBUG" ] && set -vx
9 . /usr/share/carnet-tools/functions.sh
12 cp_check_and_sed "^AllowSupplementaryGroups" \
13 "s/^AllowSupplementaryGroups/#AllowSupplementaryGroups/g" \
14 /etc/clamav/clamd.conf && restart="yes" || true
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
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
30 if [ -d /var/run/clamav ]; then
31 chown -R clamav:clamav /var/run/clamav
34 if [ -d /run/clamav ]; then
35 chown -R clamav:clamav /run/clamav
38 if [ -d /var/lib/clamav ]; then
39 chown -R clamav:clamav /var/lib/clamav
42 if [ -d /var/log/clamav ]; then
43 chown -R clamav:clamav /var/log/clamav
46 # dodaj korisnika clamav u grupu amavis (ako postoji...)
47 getent group amavis > /dev/null && usermod -G amavis clamav && restart="yes"
50 [ "$restart" = "yes" ] || exit 0
51 service clamav-daemon restart
52 service clamav-freshclam restart