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)
|
exit(1)
|
||||||
|
|
||||||
if args.disable:
|
if args.disable:
|
||||||
# For non-existing clients this actually creates them in disabled mode.
|
enabled = False
|
||||||
client.enabled = False
|
else:
|
||||||
client.commit()
|
enabled = True
|
||||||
elif args.delete:
|
|
||||||
|
if args.delete:
|
||||||
|
# This both deletes the iptables rule AND the client entry from DB.
|
||||||
client.delete()
|
client.delete()
|
||||||
else:
|
else:
|
||||||
client.enabled = True
|
if args.expires:
|
||||||
|
client.expires = args.expires
|
||||||
|
client.enabled = enabled
|
||||||
client.commit()
|
client.commit()
|
||||||
|
|
Loading…
Reference in a new issue