@@ -440,7 +440,9 @@ ensure_certificate() {
440440 certbot certonly --standalone --non-interactive --agree-tos --email " $EMAIL " -d " $DOMAIN " \
441441 --cert-name " $DOMAIN " > " $TMP /certbot.log" 2>&1 || die ' Certbot failed; see Certbot own logs'
442442 else
443- nginx_runtime_identity && nginx_port_owned 80 || die ' Port 80 owner is not the recognized Nginx service'
443+ if ! nginx_runtime_identity || ! nginx_port_owned 80; then
444+ die ' Port 80 owner is not the recognized Nginx service'
445+ fi
444446 issue_webroot_certificate
445447 # Issuance committed a persistent renewal vhost. Replan WEB changes.
446448 nginx_plan
@@ -495,7 +497,9 @@ issue_webroot_certificate() (
495497 # a later Telemt installation fails. Failure restores only ACME mutations.
496498 CERT_ONLY=1 INSTALLING=1 PLAN_MODE=acme
497499 CHANGED=() ORIGINAL=()
498- TMP=$( mktemp -d " $TMP /acme.XXXXXXXX" )
500+ local parent_tmp=$TMP
501+ local TMP
502+ TMP=$( mktemp -d " $parent_tmp /acme.XXXXXXXX" )
499503 trap cleanup EXIT
500504 trap ' exit 130' INT
501505 trap ' exit 143' TERM HUP
@@ -605,7 +609,7 @@ install_manager() {
605609 track_file " $STATE /manifest.json"
606610 jq -n --arg domain " $DOMAIN " --arg unit " $( sha256sum " $UNIT " | cut -d' ' -f1) " \
607611 --arg nginx " $( sha256sum " $NGINX_ROOT /conf.d/telemt-web-manager.conf" | cut -d' ' -f1) " \
608- --arg acme " $( [[ -f $NGINX_ROOT /conf.d/telemt-web-manager-acme.conf ]] && printf ' %s' " $ACME_ROOT " || true ) " \
612+ --arg acme " $( if [[ -f $NGINX_ROOT /conf.d/telemt-web-manager-acme.conf ]]; then printf ' %s' " $ACME_ROOT " ; fi ) " \
609613 ' {schema:1,domain:$domain,unit_sha256:$unit,nginx_sha256:$nginx,acme_webroot:$acme}' > " $STATE /manifest.json"
610614 ARMED=0
611615 say " Private WEB link: $STATE /web-link.txt (0600)"
0 commit comments