diff options
author | Wojciech Kosior <kwojtus@protonmail.com> | 2020-06-12 14:58:03 +0200 |
---|---|---|
committer | Wojciech Kosior <kwojtus@protonmail.com> | 2020-06-12 14:58:03 +0200 |
commit | 19c982a4eac92ed824490322ecd97a0c3b0685ff (patch) | |
tree | b365f9db39ce685b7c527d9221aa7149db57f6c7 | |
parent | 191c4a0dbbf10a508a65b500a00f0064b29d9c94 (diff) | |
download | 0tdns-19c982a4eac92ed824490322ecd97a0c3b0685ff.tar.gz 0tdns-19c982a4eac92ed824490322ecd97a0c3b0685ff.zip |
enable querying all vpns in one back-end instance
-rwxr-xr-x | src/hourly.py | 7 |
1 files changed, 5 insertions, 2 deletions
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): |