init-pki(): Introduce second warning before HARD removal

Only if a PKI currently exists, add a second confirmation to promote
the use of 'init-pki soft'.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This commit is contained in:
Richard T Bonhomme 2023-01-01 22:56:51 +00:00
parent b56357e1bc
commit 5f85068558
No known key found for this signature in database
GPG Key ID: 2D767DB92FB6C246

View File

@ -1021,6 +1021,16 @@ and initialize a fresh PKI here."
# now remove it:
case "$reset" in
hard)
# Promote use of soft init
confirm "Remove current 'vars' file? " yes "\
* SECOND WARNING!!!
* This will remove everything in your current PKI directory.
To keep your current settings use 'init-pki soft' instead.
Using 'init-pki soft' is recommended.
"
# # # shellcheck disable=SC2115 # Use "${var:?}" to ensure
rm -rf "$EASYRSA_PKI" || \
die "init-pki hard reset failed."