diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2022-01-04 13:07:49 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2022-01-04 13:07:49 +0100 |
commit | 1fd95708391088742c139010cc6b821add941dec (patch) | |
tree | e50c297be39089753331ba075d839e2e8a9dce01 /contrib/reresolve-dns | |
parent | embeddable-wg-library: add named wg_endpoint union (diff) | |
download | wireguard-tools-1fd95708391088742c139010cc6b821add941dec.tar.xz wireguard-tools-1fd95708391088742c139010cc6b821add941dec.zip |
reresolve-dns: use $EPOCHSECONDS instead of $(date +%s)
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rwxr-xr-x | contrib/reresolve-dns/reresolve-dns.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/reresolve-dns/reresolve-dns.sh b/contrib/reresolve-dns/reresolve-dns.sh index fd38cd4..711c332 100755 --- a/contrib/reresolve-dns/reresolve-dns.sh +++ b/contrib/reresolve-dns/reresolve-dns.sh @@ -16,7 +16,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 - (( ($(date +%s) - ${BASH_REMATCH[1]}) > 135 )) || return 0 + (( ($EPOCHSECONDS - ${BASH_REMATCH[1]}) > 135 )) || return 0 wg set "$INTERFACE" peer "$PUBLIC_KEY" endpoint "$ENDPOINT" reset_peer_section } |