8104833190b0cda06ccd4c291a25539617fe89a3
[clamav-cn.git] / 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 if [ -d /run/clamav ]; then
17   chown -R clamav:clamav /run/clamav
18 fi
19
20 if [ -d /var/lib/clamav ]; then
21   chown -R clamav:clamav /var/lib/clamav
22 fi
23
24 if [ -d /var/log/clamav ]; then
25   chown -R clamav:clamav /var/log/clamav
26 fi
27
28 # dodaj korisnika clamav u grupu amavis (ako postoji...)
29 getent group amavis > /dev/null && usermod -G amavis clamav && restart="yes"
30
31 # restart if needed
32 [ "$restart" = "yes" ] || exit 0
33 service clamav-daemon restart
34 service clamav-freshclam restart
35
36 #DEBHELPER#