recreate_index_file.sh: no support for esayrsa new layout - exit cleanly.

This commit is contained in:
Christoph 2019-07-16 17:53:01 +02:00
parent ad732b8864
commit dd2fa4c7d1

View File

@ -136,8 +136,6 @@ if [[ ${#conf_file_arr[@]} -lt 1 ]] ; then
fi fi
echo ""
declare -i i=0 declare -i i=0
if [[ ${#conf_file_arr[@]} -gt 1 ]] ; then if [[ ${#conf_file_arr[@]} -gt 1 ]] ; then
@ -167,14 +165,22 @@ if [[ ${#conf_file_arr[@]} -gt 1 ]] ; then
else else
conf_file=${conf_file_arr[0]} conf_file=${conf_file_arr[0]}
service_name="${conf_name_arr[0]}"
fi fi
echo "" echo ""
echo -e "\033[32m--\033[m" echo -e "\033[32m--\033[m"
echo "" echo ""
echononl "Load configuration file '$conf_file'.."
if [[ -f "$conf_file" ]] ; then if [[ -f "$conf_file" ]] ; then
source "$conf_file" source "$conf_file" > $log_file 2>&1
if [[ $? -eq 0 ]] ; then
echo_ok
else
echo_failed
fatal "$(cat $log_file)"
fi
else else
warn "No configuration file 'conf_file' for OpenVON Service '$service_name' found.\n Loading defaults.." warn "No configuration file 'conf_file' for OpenVON Service '$service_name' found.\n Loading defaults.."
fi fi
@ -191,6 +197,11 @@ else
fatal "OpenVPN base diretory not '$OPENVPN_BASE_DIR' not found!" fatal "OpenVPN base diretory not '$OPENVPN_BASE_DIR' not found!"
fi fi
fi fi
if [[ -d "${OPENVPN_BASE_DIR}/pki" ]] ; then
warn "Only available for old easyrsa layout managed accounts."
clean_up 0
fi
[[ -n "$KEY_DIR" ]] || KEY_DIR="${OPENVPN_BASE_DIR}/keys" [[ -n "$KEY_DIR" ]] || KEY_DIR="${OPENVPN_BASE_DIR}/keys"
[[ -n "$CRL_PEM" ]] || CRL_PEM="${KEY_DIR}/crl.pem" [[ -n "$CRL_PEM" ]] || CRL_PEM="${KEY_DIR}/crl.pem"