1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-06-12 23:57:29 +02:00
Mailu/optional/clamav/start.py

22 lines
512 B
Python
Raw Normal View History

#!/usr/bin/env python3
2018-10-22 18:01:59 +03:00
import os
2023-04-12 21:22:44 +02:00
import logging as logger
import sys
2023-04-12 21:22:44 +02:00
from socrate import system
2023-04-12 21:22:44 +02:00
system.set_env(log_filters=r'SelfCheck: Database status OK\.$')
2018-10-22 18:01:59 +03:00
# Bootstrap the database if clamav is running for the first time
if not os.path.isfile("/data/main.cvd"):
logger.info("Starting primary virus DB download")
os.system("freshclam")
2018-10-22 18:01:59 +03:00
# Run the update daemon
logger.info("Starting the update daemon")
2018-10-22 18:01:59 +03:00
os.system("freshclam -d -c 6")
# Run clamav
logger.info("Starting clamav")
os.system("clamd")