From 19c982a4eac92ed824490322ecd97a0c3b0685ff Mon Sep 17 00:00:00 2001 From: Wojciech Kosior Date: Fri, 12 Jun 2020 14:58:03 +0200 Subject: enable querying all vpns in one back-end instance --- src/hourly.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/hourly.py b/src/hourly.py index 80ad9f5..4dd8f73 100755 --- a/src/hourly.py +++ b/src/hourly.py @@ -51,8 +51,11 @@ cursor = connection.cursor() hour = strftime('%Y-%m-%d %H:00', gmtime()) vpns = get_vpn_connections(cursor, hour) -vpns = [vpn for vpn in vpns if vpn[0] in ztdns_config['handled_vpns']] -print(vpns) + +handled_vpns = ztdns_config['handled_vpns'] +if handled_vpns: + vpns = [vpn for vpn in vpns if vpn[0] in handled_vpns] + for vpn_id, config_hash in vpns: config_path = "/var/lib/0tdns/{}.ovpn".format(config_hash) if not path.isfile(config_path): -- cgit v1.2.3