Browse Source

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
master
Jonathan Golder 7 years ago
parent
commit
2ab1852eb8
  1. 4
      letsencrypt-renew.sh

4
letsencrypt-renew.sh

@ -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)

Loading…
Cancel
Save