diff --git a/clamav/freshclam.conf b/clamav/freshclam.conf index 8269848..c39d281 100644 --- a/clamav/freshclam.conf +++ b/clamav/freshclam.conf @@ -113,7 +113,7 @@ ScriptedUpdates yes # and ScriptedUpdates. It can be used multiple times to provide # fall-back mirrors. # Default: disabled -PrivateMirror mirror2.example.com +PrivateMirror mirror1.example.com #PrivateMirror mirror2.example.com # Number of database checks per day. diff --git a/scripts/wrapper-entrypoint.sh b/scripts/wrapper-entrypoint.sh index 47c43f2..36539d7 100644 --- a/scripts/wrapper-entrypoint.sh +++ b/scripts/wrapper-entrypoint.sh @@ -4,11 +4,11 @@ ls -ld /var/lib/clamav # Check if MIRROR_URL is defined and not empty if [ -n "$MIRROR_URL" ] then - # MIRROR_URL is defined, replace the PrivateMirror URL in the freshclam.conf file + # MIRROR_URL is defined, replace all the PrivateMirror URLs in the freshclam.conf file sed -i 's|PrivateMirror .*|PrivateMirror '"$MIRROR_URL"'|g' /etc/clamav/freshclam.conf else - # MIRROR_URL is not defined, comment out the PrivateMirror line - sed -i 's|^PrivateMirror|## PrivateMirror|g' /etc/clamav/freshclam.conf + # MIRROR_URL is not defined, comment out all the PrivateMirror lines + sed -i 's|^PrivateMirror|##&|' /etc/clamav/freshclam.conf fi # Execute the original entrypoint script