summaryrefslogtreecommitdiff
path: root/cronjob.py
diff options
context:
space:
mode:
Diffstat (limited to 'cronjob.py')
-rwxr-xr-xcronjob.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cronjob.py b/cronjob.py
index 84c5e24..38a19a9 100755
--- a/cronjob.py
+++ b/cronjob.py
@@ -10,11 +10,11 @@ while row := curs.fetchone():
name, asn = row
print(f'Processing {asn}-{name}...')
birdcfg = open(f'/etc/bird/peers/as{asn}{name}.conf', 'w')
- wgcfg = open(f'/etc/wireguard/wg{asn%10000}{name}.conf', 'w')
+ wgcfg = open(f'/etc/wireguard/wg{asn%10000:04}{name}.conf', 'w')
print(_bird_config(name, _get_peer_info(name, asn), _get_my_info(asn)), file=birdcfg)
print(_wg_config(name, _get_peer_info(name, asn), _get_my_info(asn)), file=wgcfg)
birdcfg.close()
wgcfg.close()
- os.system(f'systemctl enable --now wg-quick@wg-{asn}-{name}')
+ os.system(f'systemctl enable --now wg-quick@wg{asn%10000:04}{name}')
os.system('birdc configure')