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 | 437116f238d30f1b9d7b19d8d4364ed937817dff (patch) | |
tree | 9d89a39a945edb282565358c2b76da3da7850197 /contrib | |
parent | external-tests: update go version (diff) | |
download | wireguard-tools-437116f238d30f1b9d7b19d8d4364ed937817dff.tar.xz wireguard-tools-437116f238d30f1b9d7b19d8d4364ed937817dff.zip |
wg: allow in-line comments
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/reresolve-dns/reresolve-dns.sh | 5 |
1 files changed, 3 insertions, 2 deletions
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 |