]> git.ipfire.org Git - thirdparty/dehydrated.git/commitdiff
make config.sh optional
authorLukas Schauer <lukas@schauer.so>
Sun, 6 Dec 2015 14:38:52 +0000 (15:38 +0100)
committerLukas Schauer <lukas@schauer.so>
Sun, 6 Dec 2015 14:38:52 +0000 (15:38 +0100)
letsencrypt.sh

index 615a731117e68e5dbeab8ddc800962242bc095c5..15befbe58c7be3308957e5aeb56c875d9147ba97 100755 (executable)
@@ -12,7 +12,9 @@ RENEW_DAYS="14"
 KEYSIZE="4096"
 WELLKNOWN=".acme-challenges"
 
-. ./config.sh
+if [[ -e "config.sh" ]]; then
+  . ./config.sh
+fi
 
 umask 077 # paranoid umask, we're creating private keys
 
@@ -186,6 +188,11 @@ if [[ "${register}" = "1" ]]; then
   signed_request "${CA}/acme/new-reg" '{"resource": "new-reg", "agreement": "'"$LICENSE"'"}' > /dev/null
 fi
 
+if [[ ! -e "domains.txt" ]]; then
+  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
+
 # Generate certificates for all domains found in domain.txt. Check if existing certificate are about to expire
 <domains.txt sed 's/^\s*//g;s/\s*$//g' | grep -v '^#' | grep -v '^$' | while read -r line; do
   domain="$(echo $line | cut -d' ' -f1)"