Permalink
Browse files

email: Avoid using loop to check for antivirus file

  • Loading branch information...
andrewladlow committed Jul 17, 2018
1 parent 684f884 commit c341032fd616660737f51afd2d7ce96252e19243
Showing with 1 addition and 14 deletions.
  1. +1 −14 email/debian/postinst
@@ -147,20 +147,7 @@ done
#
# Only restart clamav if a domain contains an 'antivirus' file
#

antivirus_enabled=false

for domain in /srv/*; do
[ -h "$domain" ] && continue
[ ! -d "$domain" ] && continue

antivirus="$domain/config/antivirus"
if [ -e "$antivirus" ] ; then
antivirus_enabled=true
fi
done

if [ "$antivirus_enabled" = true ] ; then
if ( stat /srv/*/config/antivirus > /dev/null 2>&1 ) ; then
for i in clamav-daemon clamav-freshclam; do
service $i restart || true
done

0 comments on commit c341032

Please sign in to comment.