Terminate if temporary directory does not exist + typ0 [shellcheck]

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This commit is contained in:
Richard T Bonhomme 2022-04-18 22:07:47 +01:00
parent f503a22cc7
commit 7c2dd54214
No known key found for this signature in database
GPG Key ID: 2D767DB92FB6C246

View File

@ -347,7 +347,8 @@ secure_session() {
# temporary directory must exist
[ -n "$EASYRSA_TEMP_DIR" ] || return
[ -d "$EASYRSA_TEMP_DIR" ] || return
[ -d "$EASYRSA_TEMP_DIR" ] || die "\
Non-existant temporary directory: $EASYRSA_TEMP_DIR"
for i in 1 2 3; do
session="$(easyrsa_openssl rand -hex 4)"
@ -741,7 +742,7 @@ install_data_to_pki () {
# Only init-pki can inherit a previous session when deleting a PKI
# Only init-pki is allowed to create a new session
# 'init-pki soft' does not delete the old session, delete it now
[ -d "$EASYRSA_TEMP_DIR_session" ] && rm -rf "$EASYRSA_TEMP_DIR_session" ]
[ -d "$EASYRSA_TEMP_DIR_session" ] && rm -rf "$EASYRSA_TEMP_DIR_session"
unset -v EASYRSA_TEMP_DIR_session
fi