recreate_index_file.sh: no support for esayrsa new layout - exit cleanly.
This commit is contained in:
		| @@ -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" | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user