mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-07-06 21:15:10 +02:00
never fallback to SCRIPTDIR, this is error-prone and confusing
This commit is contained in:
+2
-8
@@ -127,8 +127,6 @@ init_system() {
|
|||||||
|
|
||||||
if [[ -e "${BASEDIR}/domains.txt" ]]; then
|
if [[ -e "${BASEDIR}/domains.txt" ]]; then
|
||||||
DOMAINS_TXT="${BASEDIR}/domains.txt"
|
DOMAINS_TXT="${BASEDIR}/domains.txt"
|
||||||
elif [[ -e "${SCRIPTDIR}/domains.txt" ]]; then
|
|
||||||
DOMAINS_TXT="${SCRIPTDIR}/domains.txt"
|
|
||||||
else
|
else
|
||||||
echo "You have to create a domains.txt file listing the domains you want certificates for. Have a look at domains.txt.example."
|
echo "You have to create a domains.txt file listing the domains you want certificates for. Have a look at domains.txt.example."
|
||||||
exit 1
|
exit 1
|
||||||
@@ -350,14 +348,10 @@ sign_domain() {
|
|||||||
_openssl x509 -text < "${crt_path}"
|
_openssl x509 -text < "${crt_path}"
|
||||||
|
|
||||||
# Create fullchain.pem
|
# Create fullchain.pem
|
||||||
if [[ -e "${BASEDIR}/certs/${ROOTCERT}" ]] || [[ -e "${SCRIPTDIR}/certs/${ROOTCERT}" ]]; then
|
if [[ -e "${BASEDIR}/certs/${ROOTCERT}" ]]; then
|
||||||
echo " + Creating fullchain.pem..."
|
echo " + Creating fullchain.pem..."
|
||||||
cat "${crt_path}" > "${BASEDIR}/certs/${domain}/fullchain-${timestamp}.pem"
|
cat "${crt_path}" > "${BASEDIR}/certs/${domain}/fullchain-${timestamp}.pem"
|
||||||
if [[ -e "${BASEDIR}/certs/${ROOTCERT}" ]]; then
|
cat "${BASEDIR}/certs/${ROOTCERT}" >> "${BASEDIR}/certs/${domain}/fullchain-${timestamp}.pem"
|
||||||
cat "${BASEDIR}/certs/${ROOTCERT}" >> "${BASEDIR}/certs/${domain}/fullchain-${timestamp}.pem"
|
|
||||||
else
|
|
||||||
cat "${SCRIPTDIR}/certs/${ROOTCERT}" >> "${BASEDIR}/certs/${domain}/fullchain-${timestamp}.pem"
|
|
||||||
fi
|
|
||||||
ln -sf "fullchain-${timestamp}.pem" "${BASEDIR}/certs/${domain}/fullchain.pem"
|
ln -sf "fullchain-${timestamp}.pem" "${BASEDIR}/certs/${domain}/fullchain.pem"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user