Minor corrections

Use move not copy (copy was used in development).

Corrections to help and error messages.

Re-arrange "hand-off" 'case'; group renew functions together.

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This commit is contained in:
Richard T Bonhomme 2022-05-21 13:40:28 +01:00
parent 303c076438
commit 305a19ea74
No known key found for this signature in database
GPG Key ID: 2D767DB92FB6C246

View File

@ -39,16 +39,16 @@ Here is the list of commands available with a short syntax reminder. Use the
renew <filename_base> [cmd-opts]
revoke-renewed <filename_base> [cmd-opts]
renewable [ <filename_base> ]
rewind-renewed <certificate-serial-number>
rewind-renew <certificate-serial-number>
gen-crl
update-db
show-req <filename_base> [ cmd-opts ]
show-cert <filename_base> [ cmd-opts ]
show-ca [ cmd-opts ]
show-crl
show-expire <filename_base> (Optional)
show-revoke <filename_base> (Optional)
show-renew <filename_base> (Optional)
show-expire [ <filename_base> ]
show-revoke [ <filename_base> ]
show-renew [ <filename_base> ]
verify <filename_base>
import-req <request_file_path> <short_basename>
export-p1 <filename_base> [ cmd-opts ]
@ -148,8 +148,8 @@ cmd_help() {
renewable) text="
renewable [ <filename_base> ]
Check which certificates can be renewed" ;;
rewind-renewed) text="
rewind-renewed <certificate-serial-number>
rewind-renew) text="
rewind-renew <certificate-serial-number>
Rewind EasyRSA version 3.0 style renewed certificates.
Moves and renames certs, keys and reqs. Use with caution!
@ -2088,7 +2088,7 @@ EOF
rewind_renew() {
# pull filename base: serial number
[ "$1" ] || die "\
Error: didn't find a file base name as the first argument.
Error: didn't find a serial number as the first argument.
Run easyrsa without commands for usage and command help."
verify_ca_init
@ -2142,11 +2142,11 @@ Cannot renew this certificate because a conflicting file exists.
unset -v deny_msg
# move crt, key and req file to renewed folders
cp "$crt_in" "$crt_out" || die "Failed to move: $crt_in"
mv "$crt_in" "$crt_out" || die "Failed to move: $crt_in"
# only move the key if we have it
if [ -e "$key_in" ]; then
if cp "$key_in" "$key_out"; then
if mv "$key_in" "$key_out"; then
: # ok
else
# Attempt restore
@ -2158,7 +2158,7 @@ Cannot renew this certificate because a conflicting file exists.
# only move the req if we have it
if [ -e "$req_in" ]; then
if cp "$req_in" "$req_out"; then
if mv "$req_in" "$req_out"; then
: # ok
else
# Attempt restore
@ -4156,6 +4156,9 @@ case "$cmd" in
renewable)
renewable "$@"
;;
rewind-renew)
rewind_renew "$@"
;;
import-req)
import_req "$@"
;;
@ -4207,9 +4210,6 @@ case "$cmd" in
show-renew)
status renew "$@"
;;
rewind-renew)
rewind_renew "$@"
;;
upgrade)
up23_manage_upgrade_23 "$@"
;;