Add option to revoke the existing certificate when creating one.
This commit is contained in:
parent
a9b2fdd832
commit
df6d06d848
18
shellpki
18
shellpki
|
@ -327,7 +327,14 @@ create() {
|
||||||
|
|
||||||
# check if CN already exist
|
# check if CN already exist
|
||||||
if [ -f "${CRT_DIR}/${cn}.crt" ]; then
|
if [ -f "${CRT_DIR}/${cn}.crt" ]; then
|
||||||
error "${cn} already used !"
|
printf "%s already exists, do you revoke and recreate it ? [y/N] " "${cn}"
|
||||||
|
read -r REPLY
|
||||||
|
resp=$(echo "${REPLY}" | tr 'Y' 'y')
|
||||||
|
if [ "${resp}" = "y" ]; then
|
||||||
|
revoke "${cn}"
|
||||||
|
else
|
||||||
|
error "Abort"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ca sign and generate cert
|
# ca sign and generate cert
|
||||||
|
@ -346,7 +353,14 @@ create() {
|
||||||
|
|
||||||
# check if CN already exist
|
# check if CN already exist
|
||||||
if [ -f "${CRT_DIR}/${cn}.crt" ]; then
|
if [ -f "${CRT_DIR}/${cn}.crt" ]; then
|
||||||
error "${cn} already used !"
|
printf "%s already exists, do you revoke and recreate it ? [y/N] " "${cn}"
|
||||||
|
read -r REPLY
|
||||||
|
resp=$(echo "${REPLY}" | tr 'Y' 'y')
|
||||||
|
if [ "${resp}" = "y" ]; then
|
||||||
|
revoke "${cn}"
|
||||||
|
else
|
||||||
|
error "Abort"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ask for CA passphrase
|
# ask for CA passphrase
|
||||||
|
|
Loading…
Reference in a new issue