Files
modoboa-installer/modoboa_installer/scripts/clamav.py
Antoine Nguyen 5496f0caef Few fixes.
Ubuntu installation (fix #4)
Generate map files when all shortcut is used (see #8)
Fix freshclam execution on Ubuntu
2015-11-06 09:45:05 +01:00

30 lines
798 B
Python

"""ClamAV related tools."""
from .. import utils
from .. import system
from . import base
class Clamav(base.Installer):
"""ClamAV installer."""
appname = "clamav"
daemon_name = "clamav-daemon"
packages = ["clamav-daemon"]
def post_run(self):
"""Additional tasks."""
user = self.config.get(self.appname, "user")
system.add_user_to_group(
user, self.config.get("amavis", "user")
)
if utils.dist_name == "ubuntu":
# Stop freshclam daemon to allow manual download
utils.exec_cmd("service clamav-freshclam stop")
utils.exec_cmd("freshclam", sudo_user=user)
utils.exec_cmd("service clamav-freshclam start")
else:
utils.exec_cmd("freshclam", sudo_user=user)