diff --git a/scripts/wrapper-entrypoint.sh b/scripts/wrapper-entrypoint.sh index 6b69a5d..47c43f2 100644 --- a/scripts/wrapper-entrypoint.sh +++ b/scripts/wrapper-entrypoint.sh @@ -1,7 +1,15 @@ #!/bin/sh ls -ld /var/lib/clamav -# Replace the PrivateMirror URL in the freshclam.conf file -sed -i 's|PrivateMirror .*|PrivateMirror '"$MIRROR_URL"'|g' /etc/clamav/freshclam.conf + +# 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 + 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 +fi # Execute the original entrypoint script exec /init \ No newline at end of file