From cf3948dab5a183ff1c2c23f6fe569251845f622d Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 27 Nov 2019 13:30:43 +0100 Subject: reresolve-dns: remove invalid anchors on regex match Reported-by: Conrad Meyer --- contrib/examples/reresolve-dns/reresolve-dns.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/examples/reresolve-dns/reresolve-dns.sh b/contrib/examples/reresolve-dns/reresolve-dns.sh index e579f86..8ab3635 100755 --- a/contrib/examples/reresolve-dns/reresolve-dns.sh +++ b/contrib/examples/reresolve-dns/reresolve-dns.sh @@ -15,7 +15,7 @@ INTERFACE="${BASH_REMATCH[1]}" process_peer() { [[ $PEER_SECTION -ne 1 || -z $PUBLIC_KEY || -z $ENDPOINT ]] && return 0 - [[ $(wg show "$INTERFACE" latest-handshakes) =~ ^${PUBLIC_KEY//+/\\+}\ ([0-9]+)$ ]] || return 0 + [[ $(wg show "$INTERFACE" latest-handshakes) =~ ${PUBLIC_KEY//+/\\+}\ ([0-9]+) ]] || return 0 (( ($(date +%s) - ${BASH_REMATCH[1]}) > 135 )) || return 0 wg set "$INTERFACE" peer "$PUBLIC_KEY" endpoint "$ENDPOINT" reset_peer_section -- cgit v1.2.3-59-g8ed1b