2018-10-31 19:17:23 +02:00
|
|
|
#!/usr/bin/python3
|
2018-10-22 17:01:59 +02:00
|
|
|
|
|
|
|
import os
|
2019-01-08 00:35:52 +02:00
|
|
|
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"))
|
2019-01-08 00:35:52 +02:00
|
|
|
logger=log.getLogger(__name__)
|
2018-10-22 17:01:59 +02:00
|
|
|
|
|
|
|
# Bootstrap the database if clamav is running for the first time
|
2019-01-08 00:35:52 +02:00
|
|
|
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
|
2019-01-08 00:35:52 +02:00
|
|
|
logger.info("Starting the update daemon")
|
2018-10-22 17:01:59 +02:00
|
|
|
os.system("freshclam -d -c 6")
|
|
|
|
|
|
|
|
# Run clamav
|
2019-01-08 00:35:52 +02:00
|
|
|
logger.info("Starting clamav")
|
2018-10-31 19:17:23 +02:00
|
|
|
os.system("clamd")
|