From: Lukas Schauer Date: Mon, 7 Dec 2015 11:36:56 +0000 (+0100) Subject: look for domains.txt under BASEDIR X-Git-Tag: v0.1.0~185 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f08fda757ee9e4e0b8a2d623ce690ce88d717eb;p=thirdparty%2Fdehydrated.git look for domains.txt under BASEDIR --- diff --git a/letsencrypt.sh b/letsencrypt.sh index 243646e..bb12bcc 100755 --- a/letsencrypt.sh +++ b/letsencrypt.sh @@ -12,7 +12,8 @@ RENEW_DAYS="14" KEYSIZE="4096" WELLKNOWN=".acme-challenges" PRIVATE_KEY_RENEW=no -BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +BASEDIR="${SCRIPTDIR}" OPENSSL_CNF="$(openssl version -d | cut -d'"' -f2)/openssl.cnf" # If exists load config from same directory as this script @@ -216,7 +217,11 @@ if [[ "${register}" = "1" ]]; then signed_request "${CA}/acme/new-reg" '{"resource": "new-reg", "agreement": "'"$LICENSE"'"}' > /dev/null fi -if [[ ! -e "domains.txt" ]]; then +if [[ -e "${BASEDIR}/domains.txt" ]]; then + DOMAINS_TXT="${BASEDIR}/domains.txt" +elif [[ -e "${SCRIPTDIR}/domains.txt" ]]; then + DOMAINS_TXT="${SCRIPTDIR}/domains.txt" +else 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 fi @@ -225,8 +230,8 @@ if [[ ! -e "${WELLKNOWN}" ]]; then mkdir -p "${WELLKNOWN}" fi -# Generate certificates for all domains found in domain.txt. Check if existing certificate are about to expire -