Make short circuit "not outdated" less complicated
This commit is contained in:
@@ -49,13 +49,12 @@ for inifile in "${LECONFIGDIR}"/cli-*.ini; do
|
||||
sleep $(expr $RANDOM % 600)
|
||||
|
||||
# Check validity of cert for domain
|
||||
openssl x509 -checkend $(( 21 * 86400 )) -in "${LECONFIGDIR}/live/${domain}/cert.pem" > /dev/null
|
||||
openssl x509 -checkend $(( 21 * 86400 )) -in "${LECONFIGDIR}/live/${domain}/cert.pem" > /dev/null && continue
|
||||
|
||||
if [ $? != 0 ]; then
|
||||
# run let's encrypt
|
||||
letsencrypt certonly -c "${inifile}"
|
||||
# import certificate
|
||||
uberspace-add-certificate -k "${LECONFIGDIR}/live/${domain}/privkey.pem" -c "${LECONFIGDIR}/live/${domain}/cert.pem"
|
||||
fi
|
||||
# run let's encrypt
|
||||
letsencrypt certonly -c "${inifile}"
|
||||
|
||||
# import certificate
|
||||
uberspace-add-certificate -k "${LECONFIGDIR}/live/${domain}/privkey.pem" -c "${LECONFIGDIR}/live/${domain}/cert.pem"
|
||||
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user