Skip to content

Commit

Permalink
Merge branch 'TinCanTech-cleanup-cleanup'
Browse files Browse the repository at this point in the history
Signed-off-by: Richard T Bonhomme <[email protected]>
  • Loading branch information
TinCanTech committed Aug 22, 2022
2 parents c63682f + edb46ca commit f13bf5e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions easyrsa3/easyrsa
Original file line number Diff line number Diff line change
Expand Up @@ -525,16 +525,15 @@ notice() {
print "
Notice
------
$1
"
$1"
} # => notice()

# Helpful information
information() {
[ "$EASYRSA_SILENT" ] && return
[ "$EASYRSA_BATCH" ] && return
[ "$EASYRSA_QUIET" ] && return
print "* $1"
print "$1"
} # => notice()

# yes/no case-insensitive match (operates on stdin pipe)
Expand Down Expand Up @@ -656,6 +655,13 @@ cleanup() {
*) warn "Host OS undefined."
esac

if [ "$EASYRSA_SILENT" ] || [ "$EASYRSA_BATCH" ] || [ "$EASYRSA_QUIET" ]
then
: # ok
else
print # just to get a clean line
fi

# Exit with error 1, if an error ocured...
if [ "$easyrsa_error_exit" ]; then
# Set by verify_cert() for full error-out
Expand All @@ -665,7 +671,6 @@ cleanup() {
exit 0
else
# if 'cleanup' is called without 'ok' then an error occurred
[ "$EASYRSA_SILENT" ] || print # just to get a clean line
exit 1
fi
} # => cleanup()
Expand Down Expand Up @@ -981,8 +986,7 @@ Your newly created PKI dir is:
: # ok - No message required
else
information "\
IMPORTANT: Easy-RSA 'vars' file has now been moved to your PKI above.
"
IMPORTANT: Easy-RSA 'vars' file has now been moved to your PKI above."
fi
} # => init_pki()

Expand Down Expand Up @@ -1114,7 +1118,6 @@ install_data_to_pki () {
#[ -e "${EASYRSA_PKI}/${vars_file}" ] || return
#[ -e "${EASYRSA_PKI}/${vars_file_example}" ] || return
[ -e "${EASYRSA_PKI}/${ssl_cnf_file}" ] || return
#[ -e "${EASYRSA_PKI}/${x509_types_dir}" ] || return

# EASYRSA_EXT_DIR must be found! No exceptions!
# The shellcheck warning 2015 is valid, however, this code works correctly.
Expand All @@ -1123,7 +1126,7 @@ install_data_to_pki () {
[ "$EASYRSA_EXT_DIR" ] && [ -e "$EASYRSA_EXT_DIR" ] || \
die "x509-types folder cannot be found: $EASYRSA_EXT_DIR"

# Complete or error
# Create a safe ssl file, Complete or error
require_safe_ssl_conf=1 # Always required
[ -e "$EASYRSA_SAFE_CONF" ] || easyrsa_openssl makesafeconf || return

Expand Down

0 comments on commit f13bf5e

Please sign in to comment.