bundles/wireguard: send pings over vpn, if pppd reconnects

This commit is contained in:
Franzi 2020-11-27 03:09:37 +01:00
parent c1885e20b6
commit 014b37082c
Signed by: kunsi
GPG key ID: 12E3D2136B818350
2 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1,12 @@
#!/bin/bash
# We need to send some traffic over the wireguard tunnel to make sure
# it gets connected. Easiest way is to simply send some pings to the
# other side.
% for peer, config in node.metadata.get('wireguard', {}).get('peers', {}).items():
% for ip in sorted(config['ips']):
# refresh connection to ${peer} ${ip}
/usr/bin/ping -c 4 ${ip.split('/')[0] if '/' in ip else ip}
% endfor
% endfor