From 840e1cf9dc1a1470172bd330beb2f4136c4cb084 Mon Sep 17 00:00:00 2001 From: Christoph Date: Tue, 16 Jul 2019 17:58:27 +0200 Subject: [PATCH] recreate_index_file.sh: some minor changes on script output. --- recreate_index_file.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/recreate_index_file.sh b/recreate_index_file.sh index 8895721..f6b2cbf 100755 --- a/recreate_index_file.sh +++ b/recreate_index_file.sh @@ -20,9 +20,16 @@ clean_up() { # Perform program exit housekeeping rm -f "$log_file" + blank_line exit $1 } +blank_line() { + if $terminal ; then + echo "" + fi +} + trim() { local var="$*" var="${var#"${var%%[![:space:]]*}"}" # remove leading whitespace characters @@ -201,6 +208,8 @@ fi if [[ -d "${OPENVPN_BASE_DIR}/pki" ]] ; then warn "Only available for old easyrsa layout managed accounts." clean_up 0 +else + blank_line fi [[ -n "$KEY_DIR" ]] || KEY_DIR="${OPENVPN_BASE_DIR}/keys" [[ -n "$CRL_PEM" ]] || CRL_PEM="${KEY_DIR}/crl.pem" @@ -226,7 +235,7 @@ else fatal "No index file '${INDEX_FILE}' found!" fi -echo +blank_line while IFS= read -r -d '' cert ; do [[ "$cert" =~ dh[[:digit:]]+\.pem ]] && continue [[ "$cert" =~ crl\.pem ]] && continue @@ -301,6 +310,7 @@ else fi -warn "Check manually if '${INDEX_FILE}' and '${SERIAL_FILE}' seems to be ok.." +warn "Check manually if '${INDEX_FILE}' and + '${SERIAL_FILE}' seems to be ok.." clean_up 0