Explains how these commands are useful for --cron

master
jtbr 2017-03-19 19:25:17 +01:00
parent 1d3855bae5
commit fa8e8fc3e3
1 changed files with 14 additions and 5 deletions

@ -1,8 +1,17 @@
Those hooks are only working with `--issue` or `--install-cert` command. 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.
```sh ```sh
acme.sh --install-cert -d example.com \ acme.sh --issue -d example.com \
--pre-hook "echo this is pre hook" \ --pre-hook "echo this is pre hook that happens before attempting to issue a certificate." \
--post-hook "echo this is post hook." \ --post-hook "echo this is post hook that happens after attempting to issue a certificate." \
--renew-hook "echo this will be called when success renewed." ....... --renew-hook "echo this will be called when certs are successfully renewed." .......
``` ```
Note: to reload the web server when installing certificates, there is a related command:
```sh
acme.sh --install-cert \
..... \
--reloadcmd "echo this runs after successfully installing certificates."
```
Keep in mind that when running `--cron`, any newly-renewed certificates will automatically be installed, and the reloadcmd will be run. Consequently, if you are using `--pre-hook` and `--post-hook` to stop and restart a web server, you probably don't want to also reload it in reloadcmd. Since `--install-cert` is typically only run once, you can just do this by hand.