From 2e9b869cf3e33b3a062a54e048aa23557a8aaba2 Mon Sep 17 00:00:00 2001 From: Richard T Bonhomme Date: Sat, 6 Jan 2024 00:27:13 +0000 Subject: [PATCH] cleanup(): For option --keep-tmp, do not try to remove temp-session The temp-session has been moved to temp-storage, so cannot be removed. Signed-off-by: Richard T Bonhomme --- easyrsa3/easyrsa | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa index 611eb3315..4b9fe9a93 100755 --- a/easyrsa3/easyrsa +++ b/easyrsa3/easyrsa @@ -902,12 +902,15 @@ Temporary session not preserved." rm -rf "$keep_tmp" mv -f "$secured_session" "$keep_tmp" print "Temp session preserved: $keep_tmp" + unset -v secured_session fi fi # remove temp-session - remove_secure_session || \ - warn "cleanup - remove_secure_session failed" + if [ "$secured_session" ]; then + remove_secure_session || \ + warn "cleanup - remove_secure_session failed" + fi fi # shellcheck disable=SC3040 # POSIX set - cleanup()