2020-11-27 02:09:37 +00:00
|
|
|
#!/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.
|
|
|
|
|
2021-02-18 17:12:25 +00:00
|
|
|
% for peer, config in node.metadata.get('wireguard/peers', {}).items():
|
2020-11-27 02:09:37 +00:00
|
|
|
% 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
|