aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-11-28 16:35:04 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2017-11-28 16:35:04 +0100
commit704b1a2a8a1fb9a134c321247857232e8baa0bd9 (patch)
tree8752eeb3b971c7bfd5d3d51cac59199a80f1be9d
parentLink to app (diff)
downloadandroid_kernel_wireguard-704b1a2a8a1fb9a134c321247857232e8baa0bd9.tar.xz
android_kernel_wireguard-704b1a2a8a1fb9a134c321247857232e8baa0bd9.zip
wg-quick: more whitespace tolerance
-rw-r--r--wg-quick.bash4
1 files changed, 2 insertions, 2 deletions
diff --git a/wg-quick.bash b/wg-quick.bash
index 4a1bce2..b07037b 100644
--- a/wg-quick.bash
+++ b/wg-quick.bash
@@ -30,8 +30,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