Added clamav installation

This commit is contained in:
Alexey Berezhok
2024-04-04 21:47:16 +03:00
parent 531866a4ab
commit d32197e3cf
3 changed files with 19 additions and 206 deletions

View File

@@ -63,7 +63,7 @@ software="nginx
mysql.${arch} mysql-common mysql-server
postgresql-server postgresql sqlite.${arch}
vsftpd proftpd bind
exim clamd spamassassin dovecot dovecot-pigeonhole
exim clamd clamav spamassassin dovecot dovecot-pigeonhole
hestia hestia-nginx hestia-php
rrdtool quota e2fsprogs fail2ban dnsutils util-linux cronie expect perl-Mail-DKIM unrar vim acl sysstat
rsyslog openssh-clients util-linux ipset zstd systemd-timesyncd jq awstats perl-Switch net-tools mc flex
@@ -837,11 +837,13 @@ if [ "$exim" = 'no' ]; then
software=$(echo "$software" | sed -e "s/exim//")
software=$(echo "$software" | sed -e "s/dovecot//")
software=$(echo "$software" | sed -e "s/clamd//")
software=$(echo "$software" | sed -e "s/clamav//")
software=$(echo "$software" | sed -e "s/spamassassin//")
software=$(echo "$software" | sed -e "s/dovecot-pigeonhole//")
fi
if [ "$clamd" = 'no' ]; then
software=$(echo "$software" | sed -e "s/clamd//")
software=$(echo "$software" | sed -e "s/clamav//")
fi
if [ "$spamd" = 'no' ]; then
software=$(echo "$software" | sed -e "s/spamassassin//")
@@ -1665,10 +1667,16 @@ fi
#----------------------------------------------------------#
if [ "$clamd" = 'yes' ]; then
useradd clamav -m -d /var/lib/clamavnew -r -s /sbin/nologin
gpasswd -a clamav mail > /dev/null 2>&1
gpasswd -a clamav exim > /dev/null 2>&1
cp -f $HESTIA_INSTALL_DIR/clamav/clamd.conf /etc/clamd.d/daemon.conf
cp -f $HESTIA_INSTALL_DIR/clamav/clamd.tmpfiles /etc/tmpfiles.d/clamav.conf
cp -f $HESTIA_INSTALL_DIR/clamav/freshclam.conf /etc/freshclam.conf
touch /var/log/freshclam.log
chown clamav:clamav /var/log/freshclam.log
rm -f /var/lib/clamav/freshclam.dat
mkdir -p /var/log/clamav
systemd-tmpfiles --create
echo -ne "[ * ] Installing ClamAV anti-virus definitions... "