rewrite #5
6
shellpki
6
shellpki
|
@ -239,6 +239,8 @@ init() {
|
||||||
passout_arg=""
|
passout_arg=""
|
||||||
if [ -n "${CA_PASSWORD:-}" ]; then
|
if [ -n "${CA_PASSWORD:-}" ]; then
|
||||||
passout_arg="-passout pass:${CA_PASSWORD}"
|
passout_arg="-passout pass:${CA_PASSWORD}"
|
||||||
|
elif [ "${non_interactive}" -eq 1 ]; then
|
||||||
|
error "In non-interactive mode, you must pass CA_PASSWORD as environment variable."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "${CA_KEY}" ]; then
|
if [ ! -f "${CA_KEY}" ]; then
|
||||||
|
@ -255,6 +257,9 @@ init() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "${CA_CERT}" ]; then
|
if [ -f "${CA_CERT}" ]; then
|
||||||
|
if [ "${non_interactive}" -eq 1 ]; then
|
||||||
|
error "${CA_CERT} already exists, erase it manually if you want to start over."
|
||||||
|
else
|
||||||
printf "%s already exists, do you really want to erase it ? [y/N] " "${CA_CERT}"
|
printf "%s already exists, do you really want to erase it ? [y/N] " "${CA_CERT}"
|
||||||
read -r REPLY
|
read -r REPLY
|
||||||
resp=$(echo "${REPLY}" | tr 'Y' 'y')
|
resp=$(echo "${REPLY}" | tr 'Y' 'y')
|
||||||
|
@ -262,6 +267,7 @@ init() {
|
||||||
rm "${CA_CERT}"
|
rm "${CA_CERT}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -f "${CA_CERT}" ]; then
|
if [ ! -f "${CA_CERT}" ]; then
|
||||||
ask_ca_password 0
|
ask_ca_password 0
|
||||||
|
|
Loading…
Reference in a new issue