acmesh-official / acme.sh

A pure Unix shell script implementing ACME client protocol
https://acme.sh
GNU General Public License v3.0
38.67k stars 4.91k forks source link

provide feedback to hook script #1511

Open ryanmasse opened 6 years ago

ryanmasse commented 6 years ago

FEATURE REQUEST:

Provide parsable feedback as a command line argument to any script being run via a pre-hook, post-hook or renew-hook.

Use case:

We have 500+ domains configured. If the cron updated 23 of them, I would like to know which 23 were updated so I can iterate over the list in my script supplied to --renew-hook so I can notify the reverse proxy cluster that supports that particular domain.

sebdeckers commented 6 years ago

FYI the current working directory of the renew hook is set to the domain path. The renew hook is invoked once per renewed domain. I am not sure this if is documented or subject to change.

Example:

acme.sh --renewAll --renew-hook identity.sh

identity.sh:

DOMAIN = basename `pwd`
echo $DOMAIN

Output:

example.net
TheSecMaven commented 3 years ago

I think this could benefit from https://github.com/acmesh-official/acme.sh/pull/3320 comment on the PR if you think so!