Hi,

reresolve-dns.sh seems to have a bug where interfaces with more than a
single peer configured do not match the output of "latest-handshakes"
correctly.  Chiefly, the ^ and $ regex anchors in the script match on
the full, multiline output of 'wg foo latest-handshakes' in bash,
rather than matching on individual lines (which is clearly the
intent).

This is observed on both bash 4.4.23 and 5.0.11.

The easiest fix to this problem is simply to remove the anchors.
There should be no issue with false positive matching, nor correctly
parsing the last handshake time.  With this minor change,
reresolve-dns.sh actually functions on my host with two peers
configured.

I did not spot any obvious way to change bash's regex line-matching
behavior.  If that exists, it may be preferable.

Thank you,
Conrad
_______________________________________________
WireGuard mailing list
[email protected]
https://lists.zx2c4.com/mailman/listinfo/wireguard

Reply via email to