From bc0a9b851ac7ac019cd429a4d1109e27120008b3 Mon Sep 17 00:00:00 2001 From: Stefan Midjich Date: Fri, 17 Nov 2017 23:54:34 +0100 Subject: [PATCH] comparing the wrong time here --- tools/manage_client.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/manage_client.py b/tools/manage_client.py index e1a6d03..8a91be1 100644 --- a/tools/manage_client.py +++ b/tools/manage_client.py @@ -165,7 +165,7 @@ if args.refresh: # Also do a purge of clients that have no traffic for 24 hrs if client.last_activity: - time_diff = client.last_activity-client.created + time_diff = current_date-client.last_activity if client.last_packets >= int(packets_val) and time_diff.days >= 1: client.enabled = False @@ -174,6 +174,10 @@ if args.refresh: ip=client.ip_address )) client.commit() + else: + if not client.enabled: + client.enabled = True + client.commit() for src_ip in args.src_ip: # Get client by IP or create a new one.