From e3284202db625a1b8407c8e856b26974fcba905c Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 22 Feb 2017 20:23:00 +0100 Subject: wg-quick: allow config files without trailing newline --- src/tools/wg-quick.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/wg-quick.bash b/src/tools/wg-quick.bash index 275594e..ccf27a9 100755 --- a/src/tools/wg-quick.bash +++ b/src/tools/wg-quick.bash @@ -31,7 +31,7 @@ parse_options() { ((($(stat -c '%#a' "$CONFIG_FILE") & 0007) == 0)) || echo "Warning: \`$CONFIG_FILE' is world accessible" >&2 INTERFACE="${BASH_REMATCH[1]}" shopt -s nocasematch - while read -r line; do + while read -r line || [[ -n $line ]]; do key="${line%%=*}"; key="${key##*( )}"; key="${key%%*( )}" value="${line#*=}"; value="${value##*( )}"; value="${value%%*( )}" [[ $key == "["* ]] && interface_section=0 -- cgit v1.2.3-59-g8ed1b