General formatting corrections (NFC)

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This commit is contained in:
Richard T Bonhomme 2022-03-31 23:00:47 +01:00
parent 14a29f9fca
commit 0d29396070
No known key found for this signature in database
GPG Key ID: 2D767DB92FB6C246

View File

@ -546,7 +546,7 @@ $help_note"
# init-pki backend:
init_pki() {
# Process command options
reset="hard"
while [ -n "$1" ]; do
case "$1" in
@ -567,25 +567,27 @@ and initialize a fresh PKI here."
# now remove it:
case "$reset" in
hard)
rm -rf "$EASYRSA_PKI" || die "Removal of PKI dir failed. Check/correct errors above"
rm -rf "$EASYRSA_PKI" || \
die "Removal of PKI dir failed. Check/correct errors above"
;;
soft)
files="ca.crt certs_by_serial ecparams index.txt index.txt.attr index.txt.old issued private reqs serial serial.old"
for i in $files; do
rm -rf "${EASYRSA_PKI:?}/$i" || die "Removal of PKI dir failed. Check/correct errors above"
for i in ca.crt certs_by_serial ecparams index.txt index.txt.attr \
index.txt.old issued private reqs serial serial.old; do
rm -rf "${EASYRSA_PKI:?}/$i" || \
die "Removal of PKI dir failed. Check/correct errors above"
done
;;
# More modes could be added here, e.g. only remove
# issued certs (and clean database), but keep CA intact.
*)
die "Removal of PKI dir failed. Unknown reset type."
;;
esac
fi
# new dirs:
for i in private reqs; do
mkdir -p "$EASYRSA_PKI/$i" || die "Failed to create PKI file structure (permissions?)"
mkdir -p "$EASYRSA_PKI/$i" || \
die "Failed to create PKI file structure (permissions?)"
done
# Install data-files into ALL new PKIs