Skip to content

Commit

Permalink
Addig in a mirror check
Browse files Browse the repository at this point in the history
If a mirror url is provided it will setup on a private mirror otherwise
it will default to the central clam mirror
  • Loading branch information
a5rar committed Nov 21, 2024
1 parent 533f4d0 commit d707e70
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions scripts/wrapper-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit d707e70

Please sign in to comment.