Skip to content

Commit

Permalink
Fixing sed command to comment out private mirrror if not being used
Browse files Browse the repository at this point in the history
  • Loading branch information
a5rar committed Nov 21, 2024
1 parent d707e70 commit ba200a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion clamav/freshclam.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions scripts/wrapper-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ba200a1

Please sign in to comment.