move sources to src/
[0tDNS.git] / src / hourly.py
blob543ed207dca5e9d79b932ac071a4724f0f00630b
1 #!/bin/python3
3 from sys import argv
4 import subprocess
6 wrapper = '/var/lib/0tdns/vpn_wrapper.sh'
7 perform_queries = '/var/lib/0tdns/perform_queries.py'
9 def get_vpn_connections(hour):
10 # TODO query database for the necessary information,
11 # for now, return some sample though-up data
12 return (
13 # vpn_id | config_path
14 (14, "./vpngate_178.254.251.12_udp_1195.ovpn"),
15 (13, "./vpngate_public-vpn-229.opengw.net_tcp_443.ovpn")
18 hour = argv[1]
19 for vpn_id, config_path in get_vpn_connections(hour):
20 subprocess.run([wrapper, config_path, perform_queries, hour])