mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-03-19 15:54:01 +01:00
Check that the detected config is a file (#211)
This commit is contained in:
committed by
Lukas Schauer
parent
785ffa5539
commit
0d8b928923
@@ -51,7 +51,7 @@ 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" ]]; then
|
||||
if [[ -f "${check_config}/config" ]]; then
|
||||
BASEDIR="${check_config}"
|
||||
CONFIG="${check_config}/config"
|
||||
break
|
||||
@@ -83,7 +83,7 @@ load_config() {
|
||||
echo "#" >&2
|
||||
echo "# !! WARNING !! No main config file found, using default config!" >&2
|
||||
echo "#" >&2
|
||||
elif [[ -e "${CONFIG}" ]]; then
|
||||
elif [[ -f "${CONFIG}" ]]; then
|
||||
echo "# INFO: Using main config file ${CONFIG}"
|
||||
BASEDIR="$(dirname "${CONFIG}")"
|
||||
# shellcheck disable=SC1090
|
||||
|
||||
Reference in New Issue
Block a user