X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=clamav-cn.git;a=blobdiff_plain;f=debian%2Fpostinst;h=8104833190b0cda06ccd4c291a25539617fe89a3;hp=6b3e95047ce4fe1473adf53f4610c9bd785965fd;hb=ab406f2206ea019032119d312bbb3fcec6104bb5;hpb=4636304b8e720844b617a5036db8a681b81e4e50 diff --git a/debian/postinst b/debian/postinst index 6b3e950..8104833 100755 --- a/debian/postinst +++ b/debian/postinst @@ -5,63 +5,32 @@ set -e [ "$1" = "configure" ] || exit 0 [ "$DEBIAN_SCRIPT_DEBUG" ] && set -vx -# Load CARNet functions +# Load CARNET Tools . /usr/share/carnet-tools/functions.sh -cp_check_and_sed "^AllowSupplementaryGroups false" \ - "s/AllowSupplementaryGroups false/AllowSupplementaryGroups true/g" \ +# obsolete option +cp_check_and_sed "^AllowSupplementaryGroups" \ + "s/^AllowSupplementaryGroups/#AllowSupplementaryGroups/g" \ /etc/clamav/clamd.conf && restart="yes" || true -if ! grep -q ^AllowSupplementaryGroups /etc/clamav/clamd.conf; then - echo "AllowSupplementaryGroups true" >> /etc/clamav/clamd.conf - reload="yes" +if [ -d /run/clamav ]; then + chown -R clamav:clamav /run/clamav fi -chown -R clamav:clamav /var/run/clamav /var/lib/clamav /var/log/clamav - -# dodaj korisnika clamav u grupu amavis (ako postoji...) -getent group amavis > /dev/null && usermod -G amavis clamav && restart="yes" - -# ispravi opciju od clamscana u amavis konfi -# --disable-summary -> --no-summary -if [ -f /etc/amavis/conf.d/15-av_scanners ]; then - cp_check_and_sed "\-\-disable-summary" \ - "s/--disable-summary/--no-summary/g" \ - /etc/amavis/conf.d/15-av_scanners && restart_amavis="yes" || true - - if [ -f /etc/amavis/conf.d/15-av_scanners.cn-old ]; then - rm -f /etc/amavis/conf.d/15-av_scanners.cn-old - fi -fi - -# izbaciti MSRBL -if ! grep -q "^unset msrbl_dbs" /etc/clamav-unofficial-sigs.conf; then - echo "unset msrbl_dbs" >> /etc/clamav-unofficial-sigs.conf +if [ -d /var/lib/clamav ]; then + chown -R clamav:clamav /var/lib/clamav fi -if [ "$restart_amavis" = "yes" ]; then - if [ -x /usr/sbin/invoke-rc.d ]; then - [ -x /etc/init.d/amavisd-cn ] && invoke-rc.d amavisd-cn restart - else - [ -x /etc/init.d/amavisd-cn ] && /etc/init.d/amavisd-cn restart - fi - # nije potreban restart clamava - restart="no" +if [ -d /var/log/clamav ]; then + chown -R clamav:clamav /var/log/clamav fi +# dodaj korisnika clamav u grupu amavis (ako postoji...) +getent group amavis > /dev/null && usermod -G amavis clamav && restart="yes" # restart if needed [ "$restart" = "yes" ] || exit 0 -if [ -x /usr/sbin/invoke-rc.d ]; then - [ -x /etc/init.d/clamav-daemon ] && invoke-rc.d clamav-daemon restart -else - [ -x /etc/init.d/clamav-daemon ] && /etc/init.d/clamav-daemon restart -fi - -if [ -x /usr/sbin/invoke-rc.d ]; then - [ -x /etc/init.d/clamav-freshclam ] && invoke-rc.d clamav-freshclam restart -else - [ -x /etc/init.d/clamav-freshclam ] && /etc/init.d/clamav-freshclam restart -fi +service clamav-daemon restart +service clamav-freshclam restart #DEBHELPER#