Skip to content

Commit c341032

Browse files
committed
email: Avoid using loop to check for antivirus file
1 parent 684f884 commit c341032

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

email/debian/postinst

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -147,20 +147,7 @@ done
147147
#
148148
# Only restart clamav if a domain contains an 'antivirus' file
149149
#
150-
151-
antivirus_enabled=false
152-
153-
for domain in /srv/*; do
154-
[ -h "$domain" ] && continue
155-
[ ! -d "$domain" ] && continue
156-
157-
antivirus="$domain/config/antivirus"
158-
if [ -e "$antivirus" ] ; then
159-
antivirus_enabled=true
160-
fi
161-
done
162-
163-
if [ "$antivirus_enabled" = true ] ; then
150+
if ( stat /srv/*/config/antivirus > /dev/null 2>&1 ) ; then
164151
for i in clamav-daemon clamav-freshclam; do
165152
service $i restart || true
166153
done

0 commit comments

Comments
 (0)