What is the proper way to create a custom hook script? I am running Code: Ubuntu 22.04.2 LTS (Jammy Jellyfish) and I have run Code: ispconfig_update.sh --force so I have the latest ISPConfig version. My problem is that I can not figure out howto use the ACME hooks. When I list the crontab there is crontab -l Code: 58 0 * * * "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh" > /dev/null I tried to modify the script Code: /root/.acme.sh/letsencrypt_renew_hook.sh and add something like echo 'TEEEEEST' and then run Code: "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh" --force --test but I am not sure the changes are being executed. When I grep for the Hook keyword I get this Code: grep Hook /root/.acme.sh/mail.xxxx.xxxx.com/mail.xxx.xxxx.com.conf Code: Le_PreHook='' Le_PostHook='' Le_RenewHook='' I do not see where the hook scripts are referenced. I tried to create /usr/local/ispconfig/server/conf-custom/scripts/letsencrypt_renew_hook.sh but as far I can see the file is being ignored.
Have you examined acme.sh documentation and wiki, and hooks are nowhere explained? https://github.com/acmesh-official/acme.sh/wiki
So the hook is not supported out of the box? I have to tweak the cron command? Are you sure about that?
Sorry but acme.sh does support hooks (see https://community.letsencrypt.org/t...s-pre-hook-post-hook-and-renew-hook-now/19596). However, I believe your question is on how to customize the hook file in ISPConfig server, so do read the hook file itself on how to customize it, as it is mentioned in there. Kindly note that hook is only supported for the server LE certs and not for other web sites.
@ahrasis I think I know where I messed up. I added the server cert to the ISPConfig as web domain and generated the cert as well from the ISPConfig. I guess that has overwritten the original cert. Is there a way to regenerate the original cert?
I see now that only the server cert has Code: Le_RenewHook='__ACME_BASE64__START_b............ My question is: How do I add a Hook for certs generated from the ISPConfig web interface?
from the docs Those hooks are only accepted by the --issue command, but will be saved and apply to --renew or --cron commands as well. As such it can be a good way to do things (like close and re-open a server, or notify of updates) that need to happen only when issuance is actually attempted.