bundlewrap/bundles/wireguard/files/pppd-ip-up
Franziska Kunsmann b06532241b
All checks were successful
bundlewrap/pipeline/head This commit looks good
bundles: use metastack syntax for metadata.get()
2021-02-18 18:12:25 +01:00

12 lines
394 B
Bash

#!/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/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