Avoid clamav fixes if clamav is disabled

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

View file

@ -141,6 +141,8 @@ if [ "$check_cron" -eq 0 ]; then
crontab -l | { cat; echo "10 2 * * 6 sudo find /home/*/tmp/ -type f -mtime +5 -exec rm {} \;"; } | crontab -
fi
unit_files="$(systemctl list-unit-files | grep clamav-daemon)"
if [[ ! "$unit_files" =~ "disabled" ]]; then
# make sure clamav-daemon.service has mkdir fix
if [ -f "/lib/systemd/system/clamav-daemon.service" ]; then
check_grep=$(grep -c 'mkdir' /lib/systemd/system/clamav-daemon.service)
@ -187,23 +189,6 @@ if [ ! -f "/usr/local/vesta/data/upgrades/change-clamav-socket-v4" ]; then
fi
fi
# Making sure mpm_event will stay
if [ ! -f "/usr/local/vesta/data/upgrades/keeping-mpm-event-2" ]; then
touch /usr/local/vesta/data/upgrades/keeping-mpm-event-2
echo "=== scheduling keeping-mpm-event check script"
echo "bash /usr/local/vesta/upd/keep_mpm_event.sh 'background' >> /usr/local/vesta/data/upgrades/keeping-mpm-event.log 2>&1" >> /usr/local/vesta/data/queue/restart.pipe
/usr/local/vesta/bin/v-add-cron-restart-job > /dev/null 2>&1
fi
# Fixing ssl directive in nginx templates
if [ "$release" -eq 9 ] || [ "$release" -eq 10 ]; then
if [ ! -f "/usr/local/vesta/data/upgrades/fix_ssl_directive_in_templates" ]; then
touch /usr/local/vesta/data/upgrades/fix_ssl_directive_in_templates
echo "=== Fixing ssl directive in nginx templates"
bash /usr/local/vesta/upd/fix_ssl_directive_in_templates.sh
fi
fi
# Block executable files inside zip/rar/tar archives in ClamAV
if [ ! -f "/usr/local/vesta/data/upgrades/clamav_block_exe_in_archives" ]; then
touch /usr/local/vesta/data/upgrades/clamav_block_exe_in_archives
@ -220,6 +205,24 @@ if [ ! -f "/usr/local/vesta/data/upgrades/clamav_block_exe_in_archives" ]; then
fi
fi
fi
fi
# Making sure mpm_event will stay
if [ ! -f "/usr/local/vesta/data/upgrades/keeping-mpm-event-2" ]; then
touch /usr/local/vesta/data/upgrades/keeping-mpm-event-2
echo "=== scheduling keeping-mpm-event check script"
echo "bash /usr/local/vesta/upd/keep_mpm_event.sh 'background' >> /usr/local/vesta/data/upgrades/keeping-mpm-event.log 2>&1" >> /usr/local/vesta/data/queue/restart.pipe
/usr/local/vesta/bin/v-add-cron-restart-job > /dev/null 2>&1
fi
# Fixing ssl directive in nginx templates
if [ "$release" -eq 9 ] || [ "$release" -eq 10 ]; then
if [ ! -f "/usr/local/vesta/data/upgrades/fix_ssl_directive_in_templates" ]; then
touch /usr/local/vesta/data/upgrades/fix_ssl_directive_in_templates
echo "=== Fixing ssl directive in nginx templates"
bash /usr/local/vesta/upd/fix_ssl_directive_in_templates.sh
fi
fi
# Clearing letsencrypt pipe
if [ ! -f "/usr/local/vesta/data/upgrades/clearing-letsencrypt-pipe" ]; then