Support some other configuration files, but they only differs in the name.
This commit is contained in:
parent
a5bffa091d
commit
3cd76426b9
@ -727,6 +727,21 @@ fi
|
|||||||
if $_copy_to_user_home_dir ; then
|
if $_copy_to_user_home_dir ; then
|
||||||
_home_dir=$(eval echo "~$user_name")
|
_home_dir=$(eval echo "~$user_name")
|
||||||
_target_dir="${_home_dir}/VPN/${_CLIENT_CN}"
|
_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
|
_failed=false
|
||||||
echo ""
|
echo ""
|
||||||
echononl " Copy key material into dir '${_target_dir}'.."
|
echononl " Copy key material into dir '${_target_dir}'.."
|
||||||
@ -741,6 +756,7 @@ if $_copy_to_user_home_dir ; then
|
|||||||
|
|
||||||
if [[ -n "$ORG_SHORTCUT" ]]; 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
|
||||||
|
cp -a "$_client_conf_file" "${_target_dir}/${ORG_SHORTCUT} $(basename $_client_conf_file)" >> $log_file 2>&1
|
||||||
else
|
else
|
||||||
cp -a "$_client_conf_file" "${_target_dir}/${KEY_CN/VPN-/}-$(basename $_client_conf_file)" >> $log_file 2>&1
|
cp -a "$_client_conf_file" "${_target_dir}/${KEY_CN/VPN-/}-$(basename $_client_conf_file)" >> $log_file 2>&1
|
||||||
fi
|
fi
|
||||||
@ -748,12 +764,20 @@ if $_copy_to_user_home_dir ; then
|
|||||||
_failed=true
|
_failed=true
|
||||||
fi
|
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
|
if [[ $? -ne 0 ]] ; then
|
||||||
_failed=true
|
_failed=true
|
||||||
fi
|
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
|
cp -a "${_CLIENT_CERT}" "${_target_dir}" >> $log_file 2>&1
|
||||||
if [[ $? -ne 0 ]] ; then
|
if [[ $? -ne 0 ]] ; then
|
||||||
_failed=true
|
_failed=true
|
||||||
|
@ -669,12 +669,17 @@ if [[ $? -ne 0 ]] ; then
|
|||||||
fi
|
fi
|
||||||
if [[ -n "$ORG_SHORTCUT" ]]; 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
|
||||||
|
cp -a "$_client_conf_file" "${_target_dir}/${ORG_SHORTCUT} $(basename $_client_conf_file)" >> $log_file 2>&1
|
||||||
else
|
else
|
||||||
cp -a "$_client_conf_file" "${_target_dir}/${KEY_CN/VPN-/}-$(basename $_client_conf_file)" >> $log_file 2>&1
|
cp -a "$_client_conf_file" "${_target_dir}/${KEY_CN/VPN-/}-$(basename $_client_conf_file)" >> $log_file 2>&1
|
||||||
fi
|
fi
|
||||||
if [[ $? -ne 0 ]] ; then
|
if [[ $? -ne 0 ]] ; then
|
||||||
_failed=true
|
_failed=true
|
||||||
fi
|
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"
|
cp -a "$_client_conf_file" "${_target_dir}/${_CLIENT_CN}.ovpn"
|
||||||
if [[ $? -ne 0 ]] ; then
|
if [[ $? -ne 0 ]] ; then
|
||||||
_failed=true
|
_failed=true
|
||||||
|
Loading…
Reference in New Issue
Block a user