Skip to content

Commit f058e7b

Browse files
author
Kristan Kenney
committed
Fix detection of clamd.conf during upgrade
1 parent 7eb1f6d commit f058e7b

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

install/upgrade/versions/latest.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,17 @@ if [ ! -z "$IMAP_SYSTEM" ]; then
3636
fi
3737
fi
3838

39+
# Fix restart queue
3940
if [ -z "$($BIN/v-list-cron-jobs admin | grep 'v-update-sys-queue restart')" ]; then
4041
command="sudo $BIN/v-update-sys-queue restart"
4142
$BIN/v-add-cron-job 'admin' '*/2' '*' '*' '*' '*' "$command"
4243
fi
4344

44-
# Remove deprecated configuration line
45-
if cat /etc/clamav/clamd.conf | grep -q "DetectBrokenExecutables"; then
46-
sed -i '/DetectBrokenExecutables/d' /etc/clamav/clamd.conf
47-
fi
45+
# Remove deprecated line from ClamAV configuration file
46+
if [ -e "/etc/clamav/clamd.conf" ]; then
47+
clamd_conf_update_check=$(grep DetectBrokenExecutables /etc/clamav/clamd.conf)
48+
if [ ! -z $clamd_conf_update_check ]; then
49+
echo "(*) Updating ClamAV configuration..."
50+
sed -i '/DetectBrokenExecutables/d' /etc/clamav/clamd.conf
51+
fi
52+
fi

0 commit comments

Comments
 (0)