From: Alex Macleod Date: Thu, 26 May 2016 13:02:15 +0000 (+0100) Subject: Check that the detected config is a file (#211) X-Git-Tag: v0.3.0~25 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0d8b9289239d9344cea62416df23a4f70f0bae22;p=thirdparty%2Fdehydrated.git Check that the detected config is a file (#211) --- diff --git a/letsencrypt.sh b/letsencrypt.sh index 4add00c..df7adf2 100755 --- a/letsencrypt.sh +++ b/letsencrypt.sh @@ -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