From dd2fa4c7d15e09a5ad84cf4622c740c3f17673da Mon Sep 17 00:00:00 2001 From: Christoph Date: Tue, 16 Jul 2019 17:53:01 +0200 Subject: [PATCH] recreate_index_file.sh: no support for esayrsa new layout - exit cleanly. --- recreate_index_file.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/recreate_index_file.sh b/recreate_index_file.sh index 0ca8777..8895721 100755 --- a/recreate_index_file.sh +++ b/recreate_index_file.sh @@ -136,8 +136,6 @@ if [[ ${#conf_file_arr[@]} -lt 1 ]] ; then fi -echo "" - declare -i i=0 if [[ ${#conf_file_arr[@]} -gt 1 ]] ; then @@ -167,14 +165,22 @@ if [[ ${#conf_file_arr[@]} -gt 1 ]] ; then else conf_file=${conf_file_arr[0]} + service_name="${conf_name_arr[0]}" fi echo "" echo -e "\033[32m--\033[m" echo "" +echononl "Load configuration file '$conf_file'.." 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 warn "No configuration file 'conf_file' for OpenVON Service '$service_name' found.\n Loading defaults.." fi @@ -191,6 +197,11 @@ else fatal "OpenVPN base diretory not '$OPENVPN_BASE_DIR' not found!" 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 "$CRL_PEM" ]] || CRL_PEM="${KEY_DIR}/crl.pem"