web: properly handle acme.sh return codes

It exits with 2 in case a renew is not necessary.
pull/852/head
Saúl Ibarra Corretgé 4 years ago
parent 4cb181c1b2
commit 700c04a629
  1. 6
      web/rootfs/etc/cont-init.d/10-config

@ -23,13 +23,15 @@ if [[ $DISABLE_HTTPS -ne 1 ]]; then
fi fi
export LE_WORKING_DIR="/config/acme.sh" export LE_WORKING_DIR="/config/acme.sh"
# TODO: move away from standalone mode to webroot mode. # TODO: move away from standalone mode to webroot mode.
if ! /config/acme.sh/acme.sh \ /config/acme.sh/acme.sh \
$STAGING \ $STAGING \
--issue \ --issue \
--standalone \ --standalone \
--pre-hook "if [[ -f /var/run/s6/services/nginx ]]; then s6-svc -d /var/run/s6/services/nginx; fi" \ --pre-hook "if [[ -f /var/run/s6/services/nginx ]]; then s6-svc -d /var/run/s6/services/nginx; fi" \
--post-hook "if [[ -f /var/run/s6/services/nginx ]]; then s6-svc -u /var/run/s6/services/nginx; fi" \ --post-hook "if [[ -f /var/run/s6/services/nginx ]]; then s6-svc -u /var/run/s6/services/nginx; fi" \
-d $LETSENCRYPT_DOMAIN ; then -d $LETSENCRYPT_DOMAIN
rc=$?
if [[ $rc -eq 1 ]]; then
echo "Failed to obtain a certificate from the Let's Encrypt CA." echo "Failed to obtain a certificate from the Let's Encrypt CA."
# this tries to get the user's attention and to spare the # this tries to get the user's attention and to spare the
# authority's rate limit: # authority's rate limit:

Loading…
Cancel
Save