This commit is contained in:
Stefan Midjich 2017-09-29 18:50:41 +02:00
parent 7e5ad9b9d8
commit a67d7f7a6d

View file

@ -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()