mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-05-17 20:36:52 +02:00
Create required certificate and chaincache directories outside of sign_domain
This commit is contained in:
+11
-9
@@ -880,15 +880,6 @@ sign_domain() {
|
|||||||
_exiterr "Certificate authority doesn't allow certificate signing"
|
_exiterr "Certificate authority doesn't allow certificate signing"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If there is no existing certificate directory => make it
|
|
||||||
if [[ ! -e "${certdir}" ]]; then
|
|
||||||
echo " + Creating new directory ${certdir} ..."
|
|
||||||
mkdir -p "${certdir}" || _exiterr "Unable to create directory ${certdir}"
|
|
||||||
fi
|
|
||||||
if [ ! -d "${CHAINCACHE}" ]; then
|
|
||||||
echo " + Creating chain cache directory ${CHAINCACHE}"
|
|
||||||
mkdir "${CHAINCACHE}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
privkey="privkey.pem"
|
privkey="privkey.pem"
|
||||||
# generate a new private key if we need or want one
|
# generate a new private key if we need or want one
|
||||||
@@ -1078,6 +1069,11 @@ command_sign_domains() {
|
|||||||
init_system
|
init_system
|
||||||
[[ -n "${HOOK}" ]] && "${HOOK}" "startup_hook"
|
[[ -n "${HOOK}" ]] && "${HOOK}" "startup_hook"
|
||||||
|
|
||||||
|
if [ ! -d "${CHAINCACHE}" ]; then
|
||||||
|
echo " + Creating chain cache directory ${CHAINCACHE}"
|
||||||
|
mkdir "${CHAINCACHE}"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -n "${PARAM_DOMAIN:-}" ]]; then
|
if [[ -n "${PARAM_DOMAIN:-}" ]]; then
|
||||||
DOMAINS_TXT="$(_mktemp)"
|
DOMAINS_TXT="$(_mktemp)"
|
||||||
if [[ -n "${PARAM_ALIAS:-}" ]]; then
|
if [[ -n "${PARAM_ALIAS:-}" ]]; then
|
||||||
@@ -1123,6 +1119,12 @@ command_sign_domains() {
|
|||||||
echo "Processing ${domain} with alternative names: ${morenames}"
|
echo "Processing ${domain} with alternative names: ${morenames}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If there is no existing certificate directory => make it
|
||||||
|
if [[ ! -e "${certdir}" ]]; then
|
||||||
|
echo " + Creating new directory ${certdir} ..."
|
||||||
|
mkdir -p "${certdir}" || _exiterr "Unable to create directory ${certdir}"
|
||||||
|
fi
|
||||||
|
|
||||||
# read cert config
|
# read cert config
|
||||||
# for now this loads the certificate specific config in a subshell and parses a diff of set variables.
|
# for now this loads the certificate specific config in a subshell and parses a diff of set variables.
|
||||||
# we could just source the config file but i decided to go this way to protect people from accidentally overriding
|
# we could just source the config file but i decided to go this way to protect people from accidentally overriding
|
||||||
|
|||||||
Reference in New Issue
Block a user