Skip to content

Commit

Permalink
Run acme.pre and acme.post (if preset) before and after the acme-client
Browse files Browse the repository at this point in the history
  • Loading branch information
rootmos committed Dec 20, 2023
1 parent 1aca901 commit d5b2e3c
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions openbsd
Original file line number Diff line number Diff line change
Expand Up @@ -922,12 +922,27 @@ class Rlib:
ls.append('')
ls.append('. /etc/rc.d/rc.subr')
ls.append('')

ls.append('rc_start() {')
ls.append(' rc_exec "${daemon} ${daemon_flags}"')
ls.append(' _ec=$?')
ls.append(' if [ _ec -eq 0 ] || [ _ec -eq 2 ]; then')
ls.append(' return 0')
ls.append(' fi')
ls.append(' if [ -x "/etc/acme.pre" ]; then')
ls.append(' rc_exec "/etc/acme.pre"; _ret=$?')
ls.append(' if [[ ${_ret} != 0 ]]; then')
ls.append(' return ${_ret}')
ls.append(' fi')
ls.append(' fi')
ls.append('')
ls.append(' rc_exec "${daemon} ${daemon_flags}"; _ret=$?')
ls.append(' ')
ls.append(' if [[ ${_ret} == 0 ]]; then')
ls.append(' if [ -x "/etc/acme.post" ]; then')
ls.append(' rc_exec "/etc/acme.post"; _ret=$?')
ls.append(' return ${_ret}')
ls.append(' fi')
ls.append(' elif [[ ${_ret} == 2 ]]; then')
ls.append(' return 0')
ls.append(' else')
ls.append(' return ${_ret}')
ls.append(' fi')
ls.append('}')
ls.append('')
ls.append('rc_cmd $1')
Expand Down

0 comments on commit d5b2e3c

Please sign in to comment.