diff options
-rwxr-xr-x | cleanup.py | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,7 +1,8 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -import logging import datetime +import logging + from control import EjabberdCtl @@ -11,7 +12,7 @@ class EjabberdCleanup(EjabberdCtl): self.ignore_hosts = [] self.ignore_usernames = [] self.dry = False - self.skip_by_roster_roster = True + self.skip_by_roster = True self.delete_not_login = True self.offline_since_days = None @@ -46,7 +47,6 @@ class EjabberdCleanup(EjabberdCtl): if lastdate != None and lastdate-datetime.datetime.now() > datetime.timedelta(days=self.offline_since_days): self.delete_user(host, user, f"last seen @ {lastdate}") return - def run(self): for host in self.fetch_vhosts(): @@ -58,8 +58,8 @@ class EjabberdCleanup(EjabberdCtl): continue self.run_user(host, user) + if __name__ == "__main__": - import json from config import Config # load config |