Skip to content

Commit

Permalink
easyrsa_openssl(): Use 'case' for command selection
Browse files Browse the repository at this point in the history
Signed-off-by: Richard T Bonhomme <[email protected]>
  • Loading branch information
TinCanTech committed Oct 27, 2023
1 parent 257af50 commit d249eeb
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -1137,24 +1137,26 @@ easyrsa_openssl() {

# Execute command - Return on success
verbose "> easyrsa_openssl - EXEC $openssl_command $*"
if [ "$openssl_command" = "makesafeconf" ]; then

case "$openssl_command" in
makesafeconf)
# COPY temp-file to safessl-easyrsa.cnf
unset -v makesafeconf
cp -f "$safe_ssl_cnf_tmp" "$EASYRSA_SAFE_CONF" && \
return
die "easyrsa_openssl: makesafeconf FAILED"
fi

# Exec SSL
if [ "$EASYRSA_SILENT_SSL" ] && [ "$EASYRSA_BATCH" ]
then
"$EASYRSA_OPENSSL" "$openssl_command" "$@" \
2>/dev/null && \
return
else
"$EASYRSA_OPENSSL" "$openssl_command" "$@" && \
return
fi
return
;;
*)
# Exec SSL
if [ "$EASYRSA_SILENT_SSL" ] && [ "$EASYRSA_BATCH" ]
then
"$EASYRSA_OPENSSL" "$openssl_command" "$@" \
2>/dev/null && \
return
else
"$EASYRSA_OPENSSL" "$openssl_command" "$@" && \
return
fi
esac

# Always fail here
die "\
Expand Down

0 comments on commit d249eeb

Please sign in to comment.