Merge branch 'TinCanTech-remove-opts-verbose-quiet'

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This commit is contained in:
Richard T Bonhomme 2022-11-30 21:40:36 +00:00
commit b6e73a45af
No known key found for this signature in database
GPG Key ID: 2D767DB92FB6C246
2 changed files with 8 additions and 24 deletions

View File

@ -17,7 +17,6 @@ Easy-RSA 3 ChangeLog
* Always ensure X509-types files exist (#581 #696) * Always ensure X509-types files exist (#581 #696)
* Expand alias '--days' to all suitable options with a period (#674) * Expand alias '--days' to all suitable options with a period (#674)
* Introduce --keep-tmp, keep temp files for debugging (#667) * Introduce --keep-tmp, keep temp files for debugging (#667)
* Introduce Option -q|--quiet, disable information output (#703)
* Add serialNumber (OID 2.5.4.5) to DN 'org' mode (#606) * Add serialNumber (OID 2.5.4.5) to DN 'org' mode (#606)
* Support ampersand and dollar-sign in vars file (#590) * Support ampersand and dollar-sign in vars file (#590)
* Introduce 'rewind-renew' (#579) * Introduce 'rewind-renew' (#579)

View File

@ -457,7 +457,6 @@ General options:
--batch : Set automatic (no-prompts when possible) mode --batch : Set automatic (no-prompts when possible) mode
--silent|-s : Disable all warnings, notices and information --silent|-s : Disable all warnings, notices and information
--sbatch : Combined --silent and --batch operating mode --sbatch : Combined --silent and --batch operating mode
--quiet|-q : Quiet mode, disable information messages only
--no-pass : Do not use passwords --no-pass : Do not use passwords
Can not be used with --passin or --passout Can not be used with --passin or --passout
@ -548,29 +547,19 @@ $1
# informational notices to stdout # informational notices to stdout
notice() { notice() {
[ "$EASYRSA_SILENT" ] && return [ "$EASYRSA_SILENT" ] && return
[ "$EASYRSA_BATCH" ] && return
print " print "
Notice Notice
------ ------
$1 $1"
"
} # => notice() } # => notice()
# Helpful information # Helpful information
information() { information() {
[ "$EASYRSA_SILENT" ] && return [ "$EASYRSA_SILENT" ] && return
[ "$EASYRSA_BATCH" ] && return
[ "$EASYRSA_QUIET" ] && return
print " print "
* $1" * $1"
} # => information() } # => information()
# Verbose status reports
verbose() {
[ "$EASYRSA_VERBOSE" ] || return 0
print "$1"
} # => verbose()
# intent confirmation helper func # intent confirmation helper func
# returns without prompting in EASYRSA_BATCH # returns without prompting in EASYRSA_BATCH
confirm() { confirm() {
@ -1074,7 +1063,8 @@ Your newly created PKI dir is:
if [ "$new_vars_true" ]; then if [ "$new_vars_true" ]; then
information "\ information "\
IMPORTANT: Easy-RSA 'vars' template file has been created in your new PKI. IMPORTANT: Easy-RSA 'vars' template file has been created in your new PKI.
Edit this 'vars' file to customise the settings for your PKI." Edit this 'vars' file to customise the settings for your PKI.
To use a global vars file, use global option --vars=<YOUR_VARS>"
elif [ "$user_vars_true" ] || [ "$old_vars_true" ] || [ "$no_new_vars" ] elif [ "$user_vars_true" ] || [ "$old_vars_true" ] || [ "$no_new_vars" ]
then then
@ -3824,7 +3814,8 @@ expire_status() {
# db serial must match certificate serial, otherwise this # db serial must match certificate serial, otherwise this
# is a renewed cert which has been replaced by an issued cert # is a renewed cert which has been replaced by an issued cert
if [ "$db_serial" != "$cert_serial" ]; then if [ "$db_serial" != "$cert_serial" ]; then
verbose "* serial mismatch: information "\
serial mismatch:
db_serial: $db_serial db_serial: $db_serial
cert_serial: $cert_serial cert_serial: $cert_serial
cert_issued: $cert_issued" cert_issued: $cert_issued"
@ -3904,7 +3895,8 @@ renew_status() {
# db serial must match certificate serial, otherwise this # db serial must match certificate serial, otherwise this
# is an issued cert that replaces a renewed cert # is an issued cert that replaces a renewed cert
if [ "$db_serial" != "$cert_serial" ]; then if [ "$db_serial" != "$cert_serial" ]; then
verbose "* serial mismatch: information "\
serial mismatch:
db_serial: $db_serial db_serial: $db_serial
cert_serial: $cert_serial cert_serial: $cert_serial
cert_file_in: $cert_file_in" cert_file_in: $cert_file_in"
@ -4060,8 +4052,8 @@ detect_host() {
# Extra diagnostics # Extra diagnostics
show_host() { show_host() {
[ "$EASYRSA_SILENT" ] && return
print_version print_version
[ "$EASYRSA_VERBOSE" ] || return 0
print "$host_out" print "$host_out"
[ "$EASYRSA_DEBUG" ] || return 0 [ "$EASYRSA_DEBUG" ] || return 0
case "$easyrsa_host_os" in case "$easyrsa_host_os" in
@ -5122,13 +5114,6 @@ while :; do
export EASYRSA_SILENT=1 export EASYRSA_SILENT=1
export EASYRSA_BATCH=1 export EASYRSA_BATCH=1
;; ;;
-q|--quiet)
empty_ok=1
export EASYRSA_QUIET=1 ;;
-v|--verbose)
empty_ok=1
export EASYRSA_VERBOSE=1
;;
--nopass|--no-pass) --nopass|--no-pass)
empty_ok=1 empty_ok=1
export EASYRSA_NO_PASS=1 export EASYRSA_NO_PASS=1