From 598b8f8617320a6efd80e615a054ca4118c8dff2 Mon Sep 17 00:00:00 2001 From: Richard T Bonhomme Date: Thu, 9 Mar 2023 20:36:27 +0000 Subject: [PATCH] Exit with error on untrapped error detected Signed-off-by: Richard T Bonhomme --- easyrsa3/easyrsa | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa index 185a024..dc4ac01 100755 --- a/easyrsa3/easyrsa +++ b/easyrsa3/easyrsa @@ -5773,10 +5773,14 @@ esac # Check for untrapped errors # shellcheck disable=SC2181 -[ $? = 0 ] || warn "Untrapped error detected!" +if [ $? = 0 ]; then + # Do 'cleanup ok' on successful completion + #print "mktemp_counter: $mktemp_counter uses" + cleanup ok +fi -# Do 'cleanup ok' on successful completion -#print "mktemp_counter: $mktemp_counter uses" -cleanup ok +# Otherwise, exit with error +warn "Untrapped error detected!" +cleanup # vim: ft=sh nu ai sw=8 ts=8 noet