mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-07-11 23:52:48 +02:00
fixed BASEDIR dependent default config values
This commit is contained in:
+11
-11
@@ -18,6 +18,17 @@ check_dependencies() {
|
|||||||
|
|
||||||
# Setup default config values, search for and load configuration files
|
# Setup default config values, search for and load configuration files
|
||||||
load_config() {
|
load_config() {
|
||||||
|
# Check for config in various locations
|
||||||
|
if [[ -z "${CONFIG:-}" ]]; then
|
||||||
|
for check_config in "/etc/letsencrypt.sh" "/usr/local/etc/letsencrypt.sh" "${PWD}" "${SCRIPTDIR}"; do
|
||||||
|
if [[ -e "${check_config}/config.sh" ]]; then
|
||||||
|
BASEDIR="${check_config}"
|
||||||
|
CONFIG="${check_config}/config.sh"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
# Default values
|
# Default values
|
||||||
CA="https://acme-v01.api.letsencrypt.org/directory"
|
CA="https://acme-v01.api.letsencrypt.org/directory"
|
||||||
LICENSE="https://letsencrypt.org/documents/LE-SA-v1.0.1-July-27-2015.pdf"
|
LICENSE="https://letsencrypt.org/documents/LE-SA-v1.0.1-July-27-2015.pdf"
|
||||||
@@ -31,17 +42,6 @@ load_config() {
|
|||||||
CONTACT_EMAIL=
|
CONTACT_EMAIL=
|
||||||
LOCKFILE="${BASEDIR}/lock"
|
LOCKFILE="${BASEDIR}/lock"
|
||||||
|
|
||||||
# Check for config in various locations
|
|
||||||
if [[ -z "${CONFIG:-}" ]]; then
|
|
||||||
for check_config in "/etc/letsencrypt.sh" "/usr/local/etc/letsencrypt.sh" "${PWD}" "${SCRIPTDIR}"; do
|
|
||||||
if [[ -e "${check_config}/config.sh" ]]; then
|
|
||||||
BASEDIR="${check_config}"
|
|
||||||
CONFIG="${check_config}/config.sh"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z "${CONFIG:-}" ]]; then
|
if [[ -z "${CONFIG:-}" ]]; then
|
||||||
echo "#" >&2
|
echo "#" >&2
|
||||||
echo "# !! WARNING !! No config file found, using default config!" >&2
|
echo "# !! WARNING !! No config file found, using default config!" >&2
|
||||||
|
|||||||
Reference in New Issue
Block a user