summaryrefslogtreecommitdiffstatshomepage
path: root/src/tools/wg-quick.bash
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-02-22 20:23:00 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2017-02-23 07:09:49 +0100
commite3284202db625a1b8407c8e856b26974fcba905c (patch)
tree4da43759e24ae8b074cd0764a0d931e4de579324 /src/tools/wg-quick.bash
parentsocket: do not try to create v6 socket when disabled (diff)
downloadwireguard-monolithic-historical-e3284202db625a1b8407c8e856b26974fcba905c.tar.xz
wireguard-monolithic-historical-e3284202db625a1b8407c8e856b26974fcba905c.zip
wg-quick: allow config files without trailing newline
Diffstat (limited to 'src/tools/wg-quick.bash')
-rwxr-xr-xsrc/tools/wg-quick.bash2
1 files changed, 1 insertions, 1 deletions
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