Browse Source

net/acme: issue_cert should always call post_checks on exit

issue_cert fuction may return without calling post_checks, which leaves
port 80 open and uhttpd configuration is not restored is listen_http was
set.

Always call post_checks when returning from issue_cert.

Signed-off-by: Alexey I. Froloff <raorn@raorn.name>
lilik-openwrt-22.03
Alexey I. Froloff 6 years ago
parent
commit
8564f61d50
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      net/acme/files/run.sh

+ 5
- 2
net/acme/files/run.sh View File

@ -180,6 +180,7 @@ issue_cert()
local failed_dir local failed_dir
local webroot local webroot
local dns local dns
local ret
config_get_bool enabled "$section" enabled 0 config_get_bool enabled "$section" enabled 0
config_get_bool use_staging "$section" use_staging config_get_bool use_staging "$section" use_staging
@ -211,8 +212,9 @@ issue_cert()
moved_staging=1 moved_staging=1
else else
log "Found previous cert config. Issuing renew." log "Found previous cert config. Issuing renew."
$ACME --home "$STATE_DIR" --renew -d "$main_domain" $acme_args || return 1
return 0
$ACME --home "$STATE_DIR" --renew -d "$main_domain" $acme_args && ret=0 || ret=1
post_checks
return $ret
fi fi
fi fi
@ -231,6 +233,7 @@ issue_cert()
else else
if [ ! -d "$webroot" ]; then if [ ! -d "$webroot" ]; then
err "$main_domain: Webroot dir '$webroot' does not exist!" err "$main_domain: Webroot dir '$webroot' does not exist!"
post_checks
return 1 return 1
fi fi
log "Using webroot dir: $webroot" log "Using webroot dir: $webroot"


Loading…
Cancel
Save