mirror of
https://codeberg.org/prof_x_pvt_ltd/captive.whump.shanti-portal
synced 2024-08-14 22:46:42 +00:00
more verbose
This commit is contained in:
parent
5b92fb2b5e
commit
64acdd080f
1 changed files with 12 additions and 0 deletions
|
@ -141,11 +141,19 @@ if args.refresh:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if client.new:
|
if client.new:
|
||||||
|
if args.verbose:
|
||||||
|
print('Creating new client:{ip}'.format(
|
||||||
|
ip=client.ip_address
|
||||||
|
))
|
||||||
client.commit()
|
client.commit()
|
||||||
|
|
||||||
if int(packets_val) != client.last_packets:
|
if int(packets_val) != client.last_packets:
|
||||||
client.last_activity = current_date
|
client.last_activity = current_date
|
||||||
client.last_packets = int(packets_val)
|
client.last_packets = int(packets_val)
|
||||||
|
if args.verbose:
|
||||||
|
print('Updating activity for client:{ip}'.format(
|
||||||
|
ip=client.ip_address
|
||||||
|
))
|
||||||
client.commit()
|
client.commit()
|
||||||
|
|
||||||
# Also do a purge of clients that have no traffic for 24 hrs
|
# Also do a purge of clients that have no traffic for 24 hrs
|
||||||
|
@ -154,6 +162,10 @@ if args.refresh:
|
||||||
|
|
||||||
if client.last_packets >= int(packets_val) and time_diff.days >= 1:
|
if client.last_packets >= int(packets_val) and time_diff.days >= 1:
|
||||||
client.enabled = False
|
client.enabled = False
|
||||||
|
if args.verbose:
|
||||||
|
print('Enabling client:{ip}'.format(
|
||||||
|
ip=client.ip_address
|
||||||
|
))
|
||||||
client.commit()
|
client.commit()
|
||||||
|
|
||||||
for src_ip in args.src_ip:
|
for src_ip in args.src_ip:
|
||||||
|
|
Loading…
Reference in a new issue