X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=clamav-cn.git;a=blobdiff_plain;f=debian%2Fpostinst;h=5e370f3fa2399576f3e6e4569516161c58e47b4c;hp=22416dbdeda4d83ef183f687feab1e8933efa029;hb=refs%2Ftags%2Fdebian%2F4%250.97.8_cn0;hpb=a64c1751113dc6bdeb38820c0831241e20a50520 diff --git a/debian/postinst b/debian/postinst index 22416db..5e370f3 100755 --- a/debian/postinst +++ b/debian/postinst @@ -3,29 +3,52 @@ set -e [ "$1" = "configure" ] || exit 0 +[ "$DEBIAN_SCRIPT_DEBUG" ] && set -vx # Load CARNet functions -#. /usr/share/carnet-tools/functions.sh - -#if dpkg --compare-versions "$2" lt 2:0.91.1-1 ; then -# cp_backup_conffile /etc/clamav/clamd.conf -# rm -f /etc/clamav/clamd.conf -# cp -a /usr/share/doc/clamav-cn/examples/clamd.conf /etc/clamav/clamd.conf -# restart="yes" -#fi -# -#if dpkg --compare-versions "$2" lt 2:0.91.1-1 ; then -# cp_backup_conffile /etc/clamav/freshclam.conf -# rm -f /etc/clamav/freshclam.conf -# cp -a /usr/share/doc/clamav-cn/examples/freshclam.conf /etc/clamav/freshclam.conf -# restart="yes" -#fi +. /usr/share/carnet-tools/functions.sh + +cp_check_and_sed "^AllowSupplementaryGroups false" \ + "s/AllowSupplementaryGroups false/AllowSupplementaryGroups true/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" +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 +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" +fi + # restart if needed [ "$restart" = "yes" ] || exit 0 if [ -x /usr/sbin/invoke-rc.d ]; then @@ -39,3 +62,5 @@ if [ -x /usr/sbin/invoke-rc.d ]; then else [ -x /etc/init.d/clamav-freshclam ] && /etc/init.d/clamav-freshclam restart fi + +#DEBHELPER#