diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-02-16 20:10:25 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-02-17 05:55:03 +0100 |
commit | a3b104108ebd06c2585d8bf4cbea1ed51c955c5e (patch) | |
tree | 18bdcdff754ce7973278dab5389c7f3b44ff39d4 /contrib/examples/reresolve-dns | |
parent | external-tests: update go version (diff) | |
download | wireguard-monolithic-historical-a3b104108ebd06c2585d8bf4cbea1ed51c955c5e.tar.xz wireguard-monolithic-historical-a3b104108ebd06c2585d8bf4cbea1ed51c955c5e.zip |
tools: allow in-line comments
Diffstat (limited to 'contrib/examples/reresolve-dns')
-rwxr-xr-x | contrib/examples/reresolve-dns/reresolve-dns.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/examples/reresolve-dns/reresolve-dns.sh b/contrib/examples/reresolve-dns/reresolve-dns.sh index 7f913ab..5b9394b 100755 --- a/contrib/examples/reresolve-dns/reresolve-dns.sh +++ b/contrib/examples/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 |