Browse Source

Fix detection of clamd.conf during upgrade

Kristan Kenney 6 years ago
parent
commit
f058e7bc7a
1 changed files with 9 additions and 4 deletions
  1. 9 4
      install/upgrade/versions/latest.sh

+ 9 - 4
install/upgrade/versions/latest.sh

@@ -36,12 +36,17 @@ if [ ! -z "$IMAP_SYSTEM" ]; then
     fi
 fi
 
+# Fix restart queue
 if [ -z "$($BIN/v-list-cron-jobs admin | grep 'v-update-sys-queue restart')" ]; then
     command="sudo $BIN/v-update-sys-queue restart"
     $BIN/v-add-cron-job 'admin' '*/2' '*' '*' '*' '*' "$command"
 fi
 
-# Remove deprecated configuration line
-if cat /etc/clamav/clamd.conf | grep -q "DetectBrokenExecutables"; then
-    sed -i '/DetectBrokenExecutables/d' /etc/clamav/clamd.conf
-fi
+# Remove deprecated line from ClamAV configuration file
+if [ -e "/etc/clamav/clamd.conf" ]; then
+    clamd_conf_update_check=$(grep DetectBrokenExecutables /etc/clamav/clamd.conf)
+    if [ ! -z $clamd_conf_update_check ]; then
+        echo "(*) Updating ClamAV configuration..."
+        sed -i '/DetectBrokenExecutables/d' /etc/clamav/clamd.conf
+    fi
+fi