diff --git a/data/Dockerfiles/clamd/bootstrap.sh b/data/Dockerfiles/clamd/bootstrap.sh index ba1cee85..e12f2bc6 100755 --- a/data/Dockerfiles/clamd/bootstrap.sh +++ b/data/Dockerfiles/clamd/bootstrap.sh @@ -6,15 +6,23 @@ if [[ "${SKIP_CLAMD}" =~ ^([yY][eE][sS]|[yY])+$ ]]; then exit 0 fi -# Create log pipes +# Prepare log pipes mkdir -p /var/log/clamav touch /var/log/clamav/clamd.log /var/log/clamav/freshclam.log chown -R clamav:clamav /var/log/clamav/ chown root:tty /dev/console chmod g+rw /dev/console -# Prepare -[[ ! -f /var/lib/clamav/whitelist.ign2 ]] && touch /var/lib/clamav/whitelist.ign2 +# Prepare whitelist +if [[ -s /etc/clamav/whitelist.ign2 ]]; then + cp /etc/clamav/whitelist.ign2 /var/lib/clamav/whitelist.ign2 + chown clamav:clamav /var/lib/clamav/whitelist.ign2 +fi +if [[ ! -f /var/lib/clamav/whitelist.ign2 ]]; then + echo "Example-Signature.Ignore-1" > /var/lib/clamav/whitelist.ign2 +fi +chown clamav:clamav /var/lib/clamav/whitelist.ign2 + dos2unix /var/lib/clamav/whitelist.ign2 sed -i '/^\s*$/d' /var/lib/clamav/whitelist.ign2