diff options
author | Wojciech Kosior <kwojtus@protonmail.com> | 2020-06-12 12:05:33 +0200 |
---|---|---|
committer | Wojciech Kosior <kwojtus@protonmail.com> | 2020-06-12 12:05:33 +0200 |
commit | 6006e6a460ea0692df7d74936d388b479bf26ad9 (patch) | |
tree | a772230d3e0c8107bd88fac5e77f0875de108541 /src | |
parent | 6b119f76190cb2f5d38f9fb52ec5b60e65d29cc4 (diff) | |
download | 0tdns-6006e6a460ea0692df7d74936d388b479bf26ad9.tar.gz 0tdns-6006e6a460ea0692df7d74936d388b479bf26ad9.zip |
add option to only handle some of the vpns on a give back-end instance
Diffstat (limited to 'src')
-rwxr-xr-x | src/hourly.py | 4 |
1 files changed, 2 insertions, 2 deletions
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" |