+++ /dev/null
-
-import os
-from time import time, strftime, localtime
-from utils import *
-from paths import *
-from cfg import *
-
-
-def check():
- now = time()
- warning_days = 15
- if cfg.has_option('global', 'warning_days'):
- warning_days = int(cfg.get('global', 'warning_days'))
- for tag in cfg.sections():
- if tag == 'global' or tag == 'ca' or tag == 'DEFAULT':
- continue
- crt_file = getpath('rsa_crt', tag)
- crt_date = getcertdate(crt_file)
- if crt_date:
- days = int((now - crt_date)/86400)
- if days > -warning_days:
- print '''
-The certificate '%s' should be renewed!
-(Expiration date: %s)
-''' % (tag, strftime('%d/%m/%Y', localtime(crt_date)))
-