Optimize install_data_to_pki()

Thanks to excellent community feedback, this patch forces a single,
reliable list of sources for EasyRSA data-files.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This commit is contained in:
Richard T Bonhomme 2022-03-28 22:44:50 +01:00
parent bc07187073
commit a8a2171716
No known key found for this signature in database
GPG Key ID: 2D767DB92FB6C246

View File

@ -609,7 +609,7 @@ install_data_to_pki () {
# Copying 'vars' to the PKI is complicated, code is included but DISABLED. # Copying 'vars' to the PKI is complicated, code is included but DISABLED.
# Set required sources # Set required sources
vars_file='vars' #vars_file='vars'
vars_file_example='vars.example' vars_file_example='vars.example'
ssl_cnf_file='openssl-easyrsa.cnf' ssl_cnf_file='openssl-easyrsa.cnf'
x509_types_dir='x509-types' x509_types_dir='x509-types'
@ -624,22 +624,19 @@ install_data_to_pki () {
return 0 return 0
fi fi
# PWD covers EasyRSA-Windows installed by OpenVPN, and git forks # PWD - Covers EasyRSA-Windows installed by OpenVPN, and git forks
area_pwd="$PWD" # "prog_dir" - Old way
# Old way # /etc/easy-rsa - Sensible default - Includes: Arch, hopefully others agree..
area_prog="${0%/*}" # /usr/share/easy-rsa - usr
# Sensible default - Includes: Arch-Linux # /usr/local/share/easy-rsa - usr/local
area_etc='/etc/easy-rsa'
# Expandable distros
area_ubuntu='/usr/share/easy-rsa'
# Add more distros here
# Find and copy data-files, in specific order # Find and copy data-files, in specific order
for area in \ for area in \
"$area_pwd" \ "$PWD" \
"$area_prog" \ "${0%/*}" \
"$area_etc" \ '/etc/easy-rsa' \
"$area_ubuntu" \ '/usr/share/easy-rsa' \
'/usr/local/share/easy-rsa' \
# EOL - # Add more distros here # EOL - # Add more distros here
do do
# Omitting "$vars_file" # Omitting "$vars_file"