aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWojciech Kosior <kwojtus@protonmail.com>2020-06-12 14:58:03 +0200
committerWojciech Kosior <kwojtus@protonmail.com>2020-06-12 14:58:03 +0200
commit19c982a4eac92ed824490322ecd97a0c3b0685ff (patch)
treeb365f9db39ce685b7c527d9221aa7149db57f6c7
parent191c4a0dbbf10a508a65b500a00f0064b29d9c94 (diff)
download0tdns-19c982a4eac92ed824490322ecd97a0c3b0685ff.tar.gz
0tdns-19c982a4eac92ed824490322ecd97a0c3b0685ff.zip
enable querying all vpns in one back-end instance
-rwxr-xr-xsrc/hourly.py7
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):