From 5d87f24b3f1be07e7013747ad06e4efb26c19559 Mon Sep 17 00:00:00 2001 From: myvesta <38690722+myvesta@users.noreply.github.com> Date: Fri, 17 Dec 2021 18:19:25 +0100 Subject: [PATCH] Checking if FreshClam is started after installation --- src/deb/vesta/postinst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/deb/vesta/postinst b/src/deb/vesta/postinst index 01b6ac48..e2a1219c 100755 --- a/src/deb/vesta/postinst +++ b/src/deb/vesta/postinst @@ -25,6 +25,18 @@ fi echo "1" > /usr/local/vesta/data/upgrades/show_changelog chmod a=rw /usr/local/vesta/data/upgrades/show_changelog +# Checking if FreshClam is started after installation +if [ ! -f "/usr/local/vesta/data/upgrades/freshclam_start" ]; then + clamavup=$(/usr/local/vesta/bin/v-list-sys-services | grep 'clamav-daemon' | grep -c 'running') + freshclamdown=$(/usr/local/vesta/bin/v-list-sys-services | grep 'clamav-freshclam' | grep -c 'off') + if [ $clamavup -eq 1 ] && [ $freshclamdown -eq 1 ]; then + echo "== Starting FreshClam" + systemctl enable clamav-freshclam.service + systemctl start clamav-freshclam.service + fi + touch /usr/local/vesta/data/upgrades/freshclam_start +fi + # Fix Autoreply issue with Exim 4.94+ if [ ! -f "/usr/local/vesta/data/upgrades/fix_exim_494_autoreply" ]; then if [ "$release" -eq 11 ]; then