diff --git a/src/wg-quick/darwin.bash b/src/wg-quick/darwin.bash index aa3edeb..a2b3789 100755 --- a/src/wg-quick/darwin.bash +++ b/src/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/wg-quick/freebsd.bash b/src/wg-quick/freebsd.bash index 72e0bd0..a72353c 100755 --- a/src/wg-quick/freebsd.bash +++ b/src/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"