diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-11-28 16:35:04 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-11-28 16:35:04 +0100 |
commit | 704b1a2a8a1fb9a134c321247857232e8baa0bd9 (patch) | |
tree | 8752eeb3b971c7bfd5d3d51cac59199a80f1be9d | |
parent | Link to app (diff) | |
download | android_kernel_wireguard-704b1a2a8a1fb9a134c321247857232e8baa0bd9.tar.xz android_kernel_wireguard-704b1a2a8a1fb9a134c321247857232e8baa0bd9.zip |
wg-quick: more whitespace tolerance
-rw-r--r-- | wg-quick.bash | 4 |
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 |