-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfigurarClamav.bash
More file actions
executable file
·37 lines (27 loc) · 950 Bytes
/
Copy pathConfigurarClamav.bash
File metadata and controls
executable file
·37 lines (27 loc) · 950 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
# Importing functions run_as_root and install_rpm_package
source RunAsRoot.bash
source RpmPackageManager.bash
# Running as root
run_as_root
# Installing requirements
bash ./Install-Flatpak.bash
# Installing ClamUI
flatpak install -y https://dl.flathub.org/repo/appstream/io.github.linx_systems.ClamUI.flatpakref
# Installing Clamav
install_rpm_package clamav clamd clamav-freshclam
# Backing up configuration file
cp /etc/clamd.d/scan.conf /etc/clamd.d/scan.conf.backup.$(date "+%d-%m-%Y_%H:%M:%S")
# Configuring Clamav
{
echo "LocalSocket /run/clamd.scan/clamd.sock"
echo "LocalSocketGroup virusgroup"
echo "LocalSocketMode 660"
} > "/etc/clamd.d/scan.conf"
# Creating usergroup virusgroup
gpasswd -a "$SUDO_USER" virusgroup
# Allowing Clamav to operate under SELinux
setsebool -P antivirus_can_scan_system 1
# Enabling Clamav
systemctl enable clamd@scan clamav-freshclam
systemctl start clamd@scan clamav-freshclam