From a67d7f7a6d041ed5455228c284693b65f11342e5 Mon Sep 17 00:00:00 2001 From: Stefan Midjich Date: Fri, 29 Sep 2017 18:50:41 +0200 Subject: [PATCH] cleanup --- tools/manage_client.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tools/manage_client.py b/tools/manage_client.py index 87da83f..a8eadef 100644 --- a/tools/manage_client.py +++ b/tools/manage_client.py @@ -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()