From 704b1a2a8a1fb9a134c321247857232e8baa0bd9 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 28 Nov 2017 16:35:04 +0100 Subject: wg-quick: more whitespace tolerance --- wg-quick.bash | 4 ++-- 1 file 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 -- cgit v1.2.3-59-g8ed1b