Fixes only if ClamAV is enabled

This commit is contained in:
myvesta 2021-11-14 20:16:27 +01:00 committed by GitHub
commit a7d96a479b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -141,8 +141,9 @@ if [ "$check_cron" -eq 0 ]; then
crontab -l | { cat; echo "10 2 * * 6 sudo find /home/*/tmp/ -type f -mtime +5 -exec rm {} \;"; } | crontab - crontab -l | { cat; echo "10 2 * * 6 sudo find /home/*/tmp/ -type f -mtime +5 -exec rm {} \;"; } | crontab -
fi fi
unit_files="$(systemctl list-unit-files | grep clamav-daemon)" if [ $(systemctl list-unit-files | grep clamav-daemon | grep -c "disabled") -eq 0 ]; then
if [[ ! "$unit_files" =~ "disabled" ]]; then # Fixes only if ClamAV is enabled
# make sure clamav-daemon.service has mkdir fix # make sure clamav-daemon.service has mkdir fix
if [ -f "/lib/systemd/system/clamav-daemon.service" ]; then if [ -f "/lib/systemd/system/clamav-daemon.service" ]; then
check_grep=$(grep -c 'mkdir' /lib/systemd/system/clamav-daemon.service) check_grep=$(grep -c 'mkdir' /lib/systemd/system/clamav-daemon.service)