aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-04-23 18:16:16 +0900
committerJason A. Donenfeld <Jason@zx2c4.com>2019-04-23 20:12:54 +0900
commit20c713b2962b817998d5e57a3fac67e9d443884c (patch)
treec475fd1443e38b8c1ac9bf38c31566f9e7ea0b7c
parentwg-quick: freebsd: workaround SIOCGIFSTATUS race in FreeBSD kernel (diff)
downloadWireGuard-master.tar.xz
WireGuard-master.zip
wg-quick: make darwin and freebsd path search strict like linuxHEADmaster
-rwxr-xr-xsrc/tools/wg-quick/darwin.bash3
-rwxr-xr-xsrc/tools/wg-quick/freebsd.bash3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/tools/wg-quick/darwin.bash b/src/tools/wg-quick/darwin.bash
index aa3edeb9..a2b37891 100755
--- a/src/tools/wg-quick/darwin.bash
+++ b/src/tools/wg-quick/darwin.bash
@@ -47,7 +47,8 @@ parse_options() {
CONFIG_FILE="$1"
if [[ $CONFIG_FILE =~ ^[a-zA-Z0-9_=+.-]{1,15}$ ]]; then
for path in "${CONFIG_SEARCH_PATHS[@]}"; do
- [[ -e $path/$CONFIG_FILE.conf ]] && { CONFIG_FILE="$path/$CONFIG_FILE.conf"; break; }
+ CONFIG_FILE="$path/$1.conf"
+ [[ -e $CONFIG_FILE ]] && break
done
fi
[[ -e $CONFIG_FILE ]] || die "\`$CONFIG_FILE' does not exist"
diff --git a/src/tools/wg-quick/freebsd.bash b/src/tools/wg-quick/freebsd.bash
index 72e0bd04..a72353c7 100755
--- a/src/tools/wg-quick/freebsd.bash
+++ b/src/tools/wg-quick/freebsd.bash
@@ -64,7 +64,8 @@ parse_options() {
CONFIG_FILE="$1"
if [[ $CONFIG_FILE =~ ^[a-zA-Z0-9_=+.-]{1,15}$ ]]; then
for path in "${CONFIG_SEARCH_PATHS[@]}"; do
- [[ -e $path/$CONFIG_FILE.conf ]] && { CONFIG_FILE="$path/$CONFIG_FILE.conf"; break; }
+ CONFIG_FILE="$path/$1.conf"
+ [[ -e $CONFIG_FILE ]] && break
done
fi
[[ -e $CONFIG_FILE ]] || die "\`$CONFIG_FILE' does not exist"