@@ -1376,6 +1376,8 @@ A vars file has not been created in your new PKI because
1376
1376
conflicting vars files have been found elsewhere."
1377
1377
prefer_vars_in_pki_msg
1378
1378
else
1379
+ unset -v EASYRSA_VARS_FILE
1380
+ select_vars
1379
1381
information "
1380
1382
Using Easy-RSA configuration:
1381
1383
* ${EASYRSA_VARS_FILE:-undefined}"
@@ -5678,9 +5680,6 @@ select_vars() {
5678
5680
No Easy-RSA 'vars' configuration file exists!"
5679
5681
EASYRSA_NO_VARS=1
5680
5682
fi
5681
-
5682
- # source the vars file
5683
- source_vars "$EASYRSA_VARS_FILE"
5684
5683
} # => select_vars()
5685
5684
5686
5685
# Source a vars file
@@ -5754,13 +5753,15 @@ Remove 'unset' ('force_set_var' may also work)."
5754
5753
5755
5754
# Test sourcing 'vars' in a subshell
5756
5755
# shellcheck disable=1090 # can't follow .. vars
5757
- ( . "$target_file" ) || \
5756
+ if ( . "$target_file" ); then
5757
+ # Source 'vars' now
5758
+ # shellcheck disable=1090 # can't follow .. vars
5759
+ . "$target_file" || \
5760
+ die "Failed to source the '$target_file' file."
5761
+ else
5762
+ PATH="$easyrsa_path"
5758
5763
die "Failed to dry-run the '$target_file' file."
5759
-
5760
- # Source 'vars' now
5761
- # shellcheck disable=1090 # can't follow .. vars
5762
- . "$target_file" || \
5763
- die "Failed to source the '$target_file' file."
5764
+ fi
5764
5765
5765
5766
PATH="$easyrsa_path"
5766
5767
verbose "source_vars: sourced OK '$target_file'"
@@ -7218,8 +7219,12 @@ case "$cmd" in
7218
7219
esac
7219
7220
7220
7221
# Intelligent env-var detection and auto-loading:
7221
- # Select and source vars file
7222
+ # Select vars file as EASYRSA_VARS_FILE
7222
7223
select_vars
7224
+
7225
+ # source the vars file
7226
+ source_vars "$EASYRSA_VARS_FILE"
7227
+
7223
7228
# then set defaults
7224
7229
default_vars
7225
7230
0 commit comments