mirror of
https://codeberg.org/prof_x_pvt_ltd/captive.whump.shanti-portal
synced 2024-08-14 22:46:42 +00:00
cleanup
This commit is contained in:
parent
7e5ad9b9d8
commit
a67d7f7a6d
1 changed files with 9 additions and 5 deletions
|
@ -96,11 +96,15 @@ except errors.StorageNotFound:
|
|||
exit(1)
|
||||
|
||||
if args.disable:
|
||||
# For non-existing clients this actually creates them in disabled mode.
|
||||
client.enabled = False
|
||||
client.commit()
|
||||
elif args.delete:
|
||||
enabled = False
|
||||
else:
|
||||
enabled = True
|
||||
|
||||
if args.delete:
|
||||
# This both deletes the iptables rule AND the client entry from DB.
|
||||
client.delete()
|
||||
else:
|
||||
client.enabled = True
|
||||
if args.expires:
|
||||
client.expires = args.expires
|
||||
client.enabled = enabled
|
||||
client.commit()
|
||||
|
|
Loading…
Reference in a new issue