-
Is there any documentation availale on how to write a renew hook? I can't seem to find anything on this other than https://github.com/acmesh-official/acme.sh/wiki/Using-pre-hook-post-hook-renew-hook-reloadcmd Is it just a standalone shell script? What parameters are available for the script? How does the script know which certificate got renewed? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Sorry for the late answer. Renew Hook is just a shell script that will be executed if you have successfully renewed your certificates, the renew hook script using your acme.sh certificate directory as a working directory, for example: So if you want to use renew hook that will be executing the file which is located outside certificate directory, then you must using command that execute the script with complete script file path as a renew hook, for example: I personally recommend that you create a shell script file in your certificate directory after issuing a certificate, so you can just using Because renew hook using certificate directory as a working directory, you can using your certificate files (like: Setting up Renew HookFor setting up a renew hook, while you want issuing a certificate, then you can add Change If you've already issued a certificate before, then you can just set up the renew hook with add You can fill
The That's all a little information about renew hook feature in acme.sh this time, I hope it helps you. |
Beta Was this translation helpful? Give feedback.
-
So the domain name in question and paths to the certificate files are not passed to the renew hook script? |
Beta Was this translation helpful? Give feedback.
In acme.sh code, there is a few lines that export some variables, including
CERT_PATH
,CERT_KEY_PATH
,CA_CERT_PATH
,Le_Domain
+DOMAIN_PATH
that you can try to insert it to your renew hook script.About working directory, it seems that acme.sh using
cd
to$DOMAIN_PATH
, that's how they're using certificate file path as a working directory.tl;dr: All of these variables can display outputs perfectly without any errors while executing renew hook, even when you're using these variables in script file as a renew hook. So you can pass the domain folder name and certificate file path with exported variable to your renew hook script if needed.
To be honest, I just tried all of these variables in …