aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-11-09 14:12:06 +0900
committerJason A. Donenfeld <Jason@zx2c4.com>2017-11-10 16:20:09 +0900
commit23f553e44e929392d78b4d628a7bdad10c5397cb (patch)
treec859d4182fa5204bd2a10779fbe90e648aaaf61a /src
parentnetlink: make sure we reserve space for NLMSG_DONE (diff)
downloadwireguard-monolithic-historical-23f553e44e929392d78b4d628a7bdad10c5397cb.tar.xz
wireguard-monolithic-historical-23f553e44e929392d78b4d628a7bdad10c5397cb.zip
wg-quick: allow for tabs in keys
Diffstat (limited to 'src')
-rwxr-xr-xsrc/tools/wg-quick.bash4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/wg-quick.bash b/src/tools/wg-quick.bash
index f69061a..42bf265 100755
--- a/src/tools/wg-quick.bash
+++ b/src/tools/wg-quick.bash
@@ -35,8 +35,8 @@ parse_options() {
INTERFACE="${BASH_REMATCH[1]}"
shopt -s nocasematch
while read -r line || [[ -n $line ]]; do
- key="${line%%=*}"; key="${key##*( )}"; key="${key%%*( )}"
- value="${line#*=}"; value="${value##*( )}"; value="${value%%*( )}"
+ key="${line%%=*}"; key="${key##*([[:space:]])}"; key="${key%%*([[:space:]])}"
+ value="${line#*=}"; value="${value##*([[:space:]])}"; value="${value%%*([[:space:]])}"
[[ $key == "["* ]] && interface_section=0
[[ $key == "[Interface]" ]] && interface_section=1
if [[ $interface_section -eq 1 ]]; then