aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/contrib/examples/reresolve-dns/reresolve-dns.sh
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-02-16 20:10:25 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2018-02-17 05:55:03 +0100
commita3b104108ebd06c2585d8bf4cbea1ed51c955c5e (patch)
tree18bdcdff754ce7973278dab5389c7f3b44ff39d4 /contrib/examples/reresolve-dns/reresolve-dns.sh
parentexternal-tests: update go version (diff)
downloadwireguard-monolithic-historical-a3b104108ebd06c2585d8bf4cbea1ed51c955c5e.tar.xz
wireguard-monolithic-historical-a3b104108ebd06c2585d8bf4cbea1ed51c955c5e.zip
tools: allow in-line comments
Diffstat (limited to '')
-rwxr-xr-xcontrib/examples/reresolve-dns/reresolve-dns.sh5
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