diff --git a/surveillance/comptes_inactifs.py b/surveillance/comptes_inactifs.py index 6fc4f7e9..34e7b8ac 100755 --- a/surveillance/comptes_inactifs.py +++ b/surveillance/comptes_inactifs.py @@ -7,7 +7,7 @@ derniereConnexion dans la base LDAP. UTILISATION - %(prog)s action + %(prog)s [action...] ACTIONS POSSIBLES %(acts)s""" @@ -22,7 +22,7 @@ from socket import gethostname from smtplib import SMTP host = gethostname() -debug = u'disconnect@crans.org' +debug = None mail_report = u'disconnect@crans.org' mail_sender = u"Comptes inactifs " template_path = '/usr/scripts/templates/comptes_inactifs.%d.txt' @@ -274,6 +274,7 @@ comptes_inactifs.py sujet, corps, server = smtp, + cc = debug, debug = debug) recapitulatif = [] @@ -286,8 +287,8 @@ comptes_inactifs.py stats[i])) recapitulatif = tableau(recapitulatif, - titre = (u"Inscrits", u"Procmail", u"Mails", u"Nombre"), - largeur = (10, 10, 7, 8), + titre = (u"Inscrits", u"Forward", u"Mails", u"Nombre"), + largeur = (10, 9, 7, 8), alignement = ('c', 'c', 'c', 'd')) recapitulatif += u""" Total : %d @@ -317,16 +318,16 @@ def usage(): if __name__ == '__main__': args = sys.argv[1:] - if len(args) != 1: - sys.stderr.write("Arguments incorrects\n") + if len(args) == 0: usage() - sys.exit(1) + sys.exit(0) - commande = args[0] - if commande not in actions: - sys.stderr.write("Commande incorrecte : %s\n" % commande) - usage() - sys.exit(2) + for commande in args: + if commande not in actions: + sys.stderr.write("Commande incorrecte : %s\n" % commande) + usage() + sys.exit(2) ci = ComptesInactifs() - eval('ci.do_%s()' % commande) + for commande in args: + eval('ci.do_%s()' % commande)