[ClamAV] Do not try to modify cross-mounted file, copy whitelist from conf to lib directory

master
andryyy 2018-10-27 13:25:05 +02:00
parent af5ce48e8d
commit e04a3aed6a
1 changed files with 11 additions and 3 deletions

View File

@ -6,15 +6,23 @@ if [[ "${SKIP_CLAMD}" =~ ^([yY][eE][sS]|[yY])+$ ]]; then
exit 0 exit 0
fi fi
# Create log pipes # Prepare log pipes
mkdir -p /var/log/clamav mkdir -p /var/log/clamav
touch /var/log/clamav/clamd.log /var/log/clamav/freshclam.log touch /var/log/clamav/clamd.log /var/log/clamav/freshclam.log
chown -R clamav:clamav /var/log/clamav/ chown -R clamav:clamav /var/log/clamav/
chown root:tty /dev/console chown root:tty /dev/console
chmod g+rw /dev/console chmod g+rw /dev/console
# Prepare # Prepare whitelist
[[ ! -f /var/lib/clamav/whitelist.ign2 ]] && touch /var/lib/clamav/whitelist.ign2 if [[ -s /etc/clamav/whitelist.ign2 ]]; then
cp /etc/clamav/whitelist.ign2 /var/lib/clamav/whitelist.ign2
chown clamav:clamav /var/lib/clamav/whitelist.ign2
fi
if [[ ! -f /var/lib/clamav/whitelist.ign2 ]]; then
echo "Example-Signature.Ignore-1" > /var/lib/clamav/whitelist.ign2
fi
chown clamav:clamav /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