Terminate if temporary directory does not exist + typ0 [shellcheck]
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This commit is contained in:
parent
f503a22cc7
commit
7c2dd54214
@ -347,7 +347,8 @@ secure_session() {
|
|||||||
|
|
||||||
# temporary directory must exist
|
# temporary directory must exist
|
||||||
[ -n "$EASYRSA_TEMP_DIR" ] || return
|
[ -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
|
for i in 1 2 3; do
|
||||||
session="$(easyrsa_openssl rand -hex 4)"
|
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 can inherit a previous session when deleting a PKI
|
||||||
# Only init-pki is allowed to create a new session
|
# Only init-pki is allowed to create a new session
|
||||||
# 'init-pki soft' does not delete the old session, delete it now
|
# '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
|
unset -v EASYRSA_TEMP_DIR_session
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user