Support some other configuration files, but they only differs in the name.

This commit is contained in:
Christoph 2020-04-13 12:47:13 +02:00
parent a5bffa091d
commit 3cd76426b9
2 changed files with 31 additions and 2 deletions

View File

@ -727,6 +727,21 @@ fi
if $_copy_to_user_home_dir ; then
_home_dir=$(eval echo "~$user_name")
_target_dir="${_home_dir}/VPN/${_CLIENT_CN}"
echononl " Backup existing dir '${_target_dir}'.."
if [[ -d "$_target_dir" ]] ; then
mv "${_target_dir}" "${_target_dir}.$_date" > $log_file 2>&1
if [[ $? -eq 0 ]]; then
echo_ok
else
echo_failed
error "$(cat $log_file)"
fi
else
echo_skipped
fi
_failed=false
echo ""
echononl " Copy key material into dir '${_target_dir}'.."
@ -741,6 +756,7 @@ if $_copy_to_user_home_dir ; then
if [[ -n "$ORG_SHORTCUT" ]]; then
cp -a "$_client_conf_file" "${_target_dir}/${ORG_SHORTCUT}-$(basename $_client_conf_file)" >> $log_file 2>&1
cp -a "$_client_conf_file" "${_target_dir}/${ORG_SHORTCUT} $(basename $_client_conf_file)" >> $log_file 2>&1
else
cp -a "$_client_conf_file" "${_target_dir}/${KEY_CN/VPN-/}-$(basename $_client_conf_file)" >> $log_file 2>&1
fi
@ -748,12 +764,20 @@ if $_copy_to_user_home_dir ; then
_failed=true
fi
# - Configuration for Windows OpenVPN
# - For historical reasons
# -
cp -a "$_client_conf_file" "${_target_dir}/${_CLIENT_CN}.ovpn"
cp -a "$_client_conf_file" "${_target_dir}/client-$(basename $_client_conf_file)" >> $log_file 2>&1
if [[ $? -ne 0 ]] ; then
_failed=true
fi
# - Configuration for Windows OpenVPN
# -
cp -a "$_client_conf_file" "${_target_dir}/${_CLIENT_CN}.ovpn" >> $log_file 2>&1
if [[ $? -ne 0 ]] ; then
_failed=true
fi
cp -a "${_CLIENT_CERT}" "${_target_dir}" >> $log_file 2>&1
if [[ $? -ne 0 ]] ; then
_failed=true

View File

@ -669,12 +669,17 @@ if [[ $? -ne 0 ]] ; then
fi
if [[ -n "$ORG_SHORTCUT" ]]; then
cp -a "$_client_conf_file" "${_target_dir}/${ORG_SHORTCUT}-$(basename $_client_conf_file)" >> $log_file 2>&1
cp -a "$_client_conf_file" "${_target_dir}/${ORG_SHORTCUT} $(basename $_client_conf_file)" >> $log_file 2>&1
else
cp -a "$_client_conf_file" "${_target_dir}/${KEY_CN/VPN-/}-$(basename $_client_conf_file)" >> $log_file 2>&1
fi
if [[ $? -ne 0 ]] ; then
_failed=true
fi
cp -a "$_client_conf_file" "${_target_dir}/client-$(basename $_client_conf_file)" >> $log_file 2>&1
if [[ $? -ne 0 ]] ; then
_failed=true
fi
cp -a "$_client_conf_file" "${_target_dir}/${_CLIENT_CN}.ovpn"
if [[ $? -ne 0 ]] ; then
_failed=true