From 9715751815a73a9a8cb7a4daf47c1cb7c6e79150 Mon Sep 17 00:00:00 2001 From: Xavier Bachelot Date: Fri, 22 Mar 2019 16:00:06 +0100 Subject: [PATCH] Automatically create missing renewed dirs Signed-off-by: Xavier Bachelot --- easyrsa3/easyrsa | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa index c1f098b..57cff16 100755 --- a/easyrsa3/easyrsa +++ b/easyrsa3/easyrsa @@ -1108,6 +1108,11 @@ input in file: $req_in" key_by_serial_renewed="$EASYRSA_PKI/renewed/private_by_serial/$cert_serial.key" req_by_serial_renewed="$EASYRSA_PKI/renewed/reqs_by_serial/$cert_serial.req" + # make sure renewed dirs exist + [ -d "$EASYRSA_PKI/renewed" ] || mkdir "$EASYRSA_PKI/renewed" + [ -d "$EASYRSA_PKI/renewed/certs_by_serial" ] || mkdir "$EASYRSA_PKI/renewed/certs_by_serial" + [ -d "$EASYRSA_PKI/renewed/private_by_serial" ] || mkdir "$EASYRSA_PKI/renewed/private_by_serial" + [ -d "$EASYRSA_PKI/renewed/reqs_by_serial" ] || mkdir "$EASYRSA_PKI/renewed/reqs_by_serial" # move crt, key and req file to renewed folders mv "$crt_in" "$crt_by_serial_renewed"