From ab4e3e5de1664956b6bfb916d51c0b77bef07c84 Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Wed, 6 May 2020 00:38:57 +0200 Subject: [PATCH] Rename `--revoke-existing` to `--replace-existing` --- CHANGELOG.md | 2 +- shellpki | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55c644b..2554e03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Accept `--days` and `--end-date` command line options * CA key length is configurable (minimum 4096) * Add `--non-interactive` command line option -* Add `--revoke-existing` command line option +* Add `--replace-existing` command line option ### Changed diff --git a/shellpki b/shellpki index 0c6e698..49efbcf 100755 --- a/shellpki +++ b/shellpki @@ -261,16 +261,16 @@ ask_user_password() { warning "Warning: empty password from input" fi } -revoke_existing_or_abort() { +replace_existing_or_abort() { cn=${1:?} if [ "${non_interactive}" -eq 1 ]; then - if [ "${revoke_existing}" -eq 1 ]; then + if [ "${replace_existing}" -eq 1 ]; then resp="y" else - error "${cn} already exists, use \`--revoke-existing' to force" + error "${cn} already exists, use \`--replace-existing' to force" fi else - if [ "${revoke_existing}" -eq 1 ]; then + if [ "${replace_existing}" -eq 1 ]; then resp="y" else printf "%s already exists, do you want to revoke and recreate it ? [y/N] " "${cn}" @@ -288,7 +288,7 @@ create() { from_csr=0 ask_pass=0 non_interactive=0 - revoke_existing=0 + replace_existing=0 days="" end_date="" @@ -384,8 +384,8 @@ create() { --non-interactive) non_interactive=1 ;; - --revoke-existing) - revoke_existing=1 + --replace-existing) + replace_existing=1 ;; --) # End of all options. @@ -466,7 +466,7 @@ create() { # check if CN already exist if [ -f "${crt_file}" ]; then - revoke_existing_or_abort "${cn}" + replace_existing_or_abort "${cn}" fi # ca sign and generate cert @@ -501,7 +501,7 @@ create() { # check if CN already exist if [ -f "${crt_file}" ]; then - revoke_existing_or_abort "${cn}" + replace_existing_or_abort "${cn}" fi # ask for CA passphrase