diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa index c7c7871..7820c52 100755 --- a/easyrsa3/easyrsa +++ b/easyrsa3/easyrsa @@ -2981,6 +2981,16 @@ subjectAltName = $val" ;; shift done +# Register cleanup on EXIT +trap "cleanup" EXIT +# When SIGHUP, SIGINT, SIGQUIT, SIGABRT and SIGTERM, +# explicitly exit to signal EXIT (non-bash shells) +trap "exit 1" 1 +trap "exit 2" 2 +trap "exit 3" 3 +trap "exit 6" 6 +trap "exit 14" 15 + # Set cmd now because vars_setup needs to know if this is init-pki cmd="$1" [ -n "$1" ] && shift # scrape off command @@ -2997,16 +3007,6 @@ esac # Intelligent env-var detection and auto-loading: vars_setup -# Register cleanup on EXIT -trap "cleanup" EXIT -# When SIGHUP, SIGINT, SIGQUIT, SIGABRT and SIGTERM, -# explicitly exit to signal EXIT (non-bash shells) -trap "exit 1" 1 -trap "exit 2" 2 -trap "exit 3" 3 -trap "exit 6" 6 -trap "exit 14" 15 - # determine how we were called, then hand off to the function responsible case "$cmd" in init-pki|clean-all)