From 6006e6a460ea0692df7d74936d388b479bf26ad9 Mon Sep 17 00:00:00 2001 From: Wojciech Kosior Date: Fri, 12 Jun 2020 12:05:33 +0200 Subject: add option to only handle some of the vpns on a give back-end instance --- src/hourly.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/hourly.py b/src/hourly.py index 2c87bee..7396bc2 100755 --- a/src/hourly.py +++ b/src/hourly.py @@ -50,7 +50,7 @@ hour = strftime('%Y-%m-%d %H:00', gmtime()) vpns = get_vpn_connections(cursor, hour) -for vpn_id, config_hash in vpns: +for vpn_id, config_hash in vpns if vpn_id in ztdns_config['handled_vpns']: config_path = "/var/lib/0tdns/{}.ovpn".format(config_hash) if not path.isfile(config_path): sync_ovpn_config(cursor, vpn_id, config_path, config_hash) @@ -58,7 +58,7 @@ for vpn_id, config_hash in vpns: cursor.close() connection.close() -for vpn_id, config_hash in vpns: +for vpn_id, config_hash in vpns if vpn_id in ztdns_config['handled_vpns']: config_path = "/var/lib/0tdns/{}.ovpn".format(config_hash) physical_ip = get_default_host_address(ztdns_config['database']) route_through_veth = ztdns_config['database'] + "/32" -- cgit v1.2.3