mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2024-12-27 09:19:15 +08:00
[ClamAV] Create directory before handling whitelist
This commit is contained in:
parent
354ecd727c
commit
db17a304b0
@ -7,6 +7,9 @@ if [[ "${SKIP_CLAMD}" =~ ^([yY][eE][sS]|[yY])+$ ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Prepare whitelist
|
# Prepare whitelist
|
||||||
|
|
||||||
|
mkdir -p /run/clamav /var/lib/clamav
|
||||||
|
|
||||||
if [[ -s /etc/clamav/whitelist.ign2 ]]; then
|
if [[ -s /etc/clamav/whitelist.ign2 ]]; then
|
||||||
echo "Copying non-empty whitelist.ign2 to /var/lib/clamav/whitelist.ign2"
|
echo "Copying non-empty whitelist.ign2 to /var/lib/clamav/whitelist.ign2"
|
||||||
cp /etc/clamav/whitelist.ign2 /var/lib/clamav/whitelist.ign2
|
cp /etc/clamav/whitelist.ign2 /var/lib/clamav/whitelist.ign2
|
||||||
@ -16,14 +19,15 @@ if [[ ! -f /var/lib/clamav/whitelist.ign2 ]]; then
|
|||||||
echo "Example-Signature.Ignore-1" > /var/lib/clamav/whitelist.ign2
|
echo "Example-Signature.Ignore-1" > /var/lib/clamav/whitelist.ign2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p /run/clamav /var/lib/clamav
|
|
||||||
|
|
||||||
chown clamav:clamav -R /var/lib/clamav /run/clamav
|
chown clamav:clamav -R /var/lib/clamav /run/clamav
|
||||||
|
|
||||||
chmod 755 /var/lib/clamav
|
chmod 755 /var/lib/clamav
|
||||||
chmod 644 -R /var/lib/clamav/*
|
chmod 644 -R /var/lib/clamav/*
|
||||||
chmod 750 /run/clamav
|
chmod 750 /run/clamav
|
||||||
|
|
||||||
|
echo "Stating whitelist.ign2"
|
||||||
|
stat /var/lib/clamav/whitelist.ign2
|
||||||
|
|
||||||
dos2unix /var/lib/clamav/whitelist.ign2
|
dos2unix /var/lib/clamav/whitelist.ign2
|
||||||
|
|
||||||
sed -i '/^\s*$/d' /var/lib/clamav/whitelist.ign2
|
sed -i '/^\s*$/d' /var/lib/clamav/whitelist.ign2
|
||||||
|
Loading…
Reference in New Issue
Block a user