1
0
mirror of https://github.com/Mailu/Mailu.git synced 2024-12-14 10:53:30 +02:00
Mailu/optional/clamav/start.py

22 lines
526 B
Python
Raw Normal View History

#!/usr/bin/python3
2018-10-22 17:01:59 +02:00
import os
import logging as log
import sys
2019-01-08 05:26:04 +02:00
log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", "WARNING"))
logger=log.getLogger(__name__)
2018-10-22 17:01:59 +02: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 17:01:59 +02:00
# Run the update daemon
logger.info("Starting the update daemon")
2018-10-22 17:01:59 +02:00
os.system("freshclam -d -c 6")
# Run clamav
logger.info("Starting clamav")
os.system("clamd")