From 437116f238d30f1b9d7b19d8d4364ed937817dff Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 16 Feb 2018 20:10:25 +0100 Subject: wg: allow in-line comments Signed-off-by: Jason A. Donenfeld --- contrib/reresolve-dns/reresolve-dns.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'contrib') diff --git a/contrib/reresolve-dns/reresolve-dns.sh b/contrib/reresolve-dns/reresolve-dns.sh index 7f913ab..5b9394b 100755 --- a/contrib/reresolve-dns/reresolve-dns.sh +++ b/contrib/reresolve-dns/reresolve-dns.sh @@ -29,8 +29,9 @@ reset_peer_section() { reset_peer_section while read -r line || [[ -n $line ]]; do - key="${line%%=*}"; key="${key##*([[:space:]])}"; key="${key%%*([[:space:]])}" - value="${line#*=}"; value="${value##*([[:space:]])}"; value="${value%%*([[:space:]])}" + stripped="${line%%\#*}" + key="${stripped%%=*}"; key="${key##*([[:space:]])}"; key="${key%%*([[:space:]])}" + value="${stripped#*=}"; value="${value##*([[:space:]])}"; value="${value%%*([[:space:]])}" [[ $key == "["* ]] && { process_peer; reset_peer_section; } [[ $key == "[Peer]" ]] && PEER_SECTION=1 if [[ $PEER_SECTION -eq 1 ]]; then -- cgit v1.2.3-59-g8ed1b