Handle the case where --days argument is not a number or a negative one
Before this test, the error was displayed but ignored and the certificate was still created depending on the default_days value in openssl.cnf
This commit is contained in:
parent
abf6fb131c
commit
9f13a42355
7
shellpki
7
shellpki
|
@ -502,8 +502,13 @@ create() {
|
|||
|
||||
# Set expiration argument
|
||||
crt_expiration_arg=""
|
||||
if [ -n "${days}" ] && [ "${days}" -gt 0 ]; then
|
||||
if [ -n "${days}" ]; then
|
||||
if [ "${days}" -gt 0 ]; then
|
||||
crt_expiration_arg="-days ${days}"
|
||||
else
|
||||
error "Argument error: \"${days}\" is not a valid value for \`--days'."
|
||||
echo $days
|
||||
fi
|
||||
fi
|
||||
if [ -n "${end_date}" ]; then
|
||||
if [ "${SYSTEM}" = "linux" ]; then
|
||||
|
|
Loading…
Reference in a new issue