Read domain from inifile

Read the domain from inifile property domains instead of using filename
As letsencrypt uses this value, missconfigurations should be nearly
impossible this way
This commit is contained in:
2017-02-10 17:02:09 +01:00
parent 0bc92aa2ee
commit 2ab1852eb8
+2 -2
View File
@@ -42,8 +42,8 @@ fi
# Get all existing inifiles matching namescheme cli-${domain}.ini
for inifile in "${LECONFIGDIR}"/cli-*.ini; do
# Strip domain out of filename
domain=${inifile:$(( ${#LECONFIGDIR} + 5 )):-4}
# Get domain out of file (first value in property "domains")
domain=$(grep -e "[ \t]*domains.*" "${inifile}" | sed "s/ //g" |cut -d "=" -f2 | cut -d "," -f1)
# sleep for a random time so not all certificates get renewed at the same time
sleep $(expr $RANDOM % 600)