bundles/wireguard: re-add reconnect script for added resiliency
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good

This commit is contained in:
Franzi 2021-09-30 06:37:42 +02:00
parent 13057d6f76
commit 8656f99f8e
Signed by: kunsi
GPG key ID: 12E3D2136B818350
2 changed files with 10 additions and 5 deletions

View file

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

View file

@ -28,3 +28,10 @@ for number, (peer, config) in enumerate(sorted(node.metadata.get('wireguard/peer
'svc_systemd:systemd-networkd:restart', 'svc_systemd:systemd-networkd:restart',
}, },
} }
if node.has_bundle('pppd'):
files['/etc/ppp/ip-up.d/reconnect-wireguard'] = {
'source': 'pppd-ip-up',
'content_type': 'mako',
'mode': '0755',
}