Acme.sh run bash script after cert renwal

no it displays ">"

1 Like

if i try with no "" i get

bash-3.2# /Users/localuser/.acme.sh/acme.sh --install-cert -d name.domain.com -d autodiscover.domain.com --key-file /usr/local/kerio/mailserver/sslcert/server.key --fullchain-file /usr/local/kerio/mailserver/sslcert/server.crt --reloadcmd /usr/local/kerio/mailserver/keriomailserver restart

[Wed 12 Jan 2022 15:49:33 AEDT] Unknown parameter : restart

1 Like

ok it finally worked and actually ran the whole thing including restating the live server by only " " the relaoad-cmd so the exact command below for OSX system :

/Users/localuser/.acme.sh/acme.sh --install-cert -d name.domain.com -d autodiscover.domain.com --key-file /usr/local/kerio/mailserver/sslcert/server.key --fullchain-file /usr/local/kerio/mailserver/sslcert/server.crt --reloadcmd "/usr/local/kerio/mailserver/keriomailserver restart"

Thankyou AZ !

2 Likes

Does that mean the cron i just added now will restart the service every day ? If the server had no cron job in the first place ?

1 Like

The cronjob will run every day, yes, but it won't do anything unless a certificate is due to be renewed.

1 Like

if there is only one cron job and that is the above how can i ensure the certs will be renewed ?
is there a command to check the renewal process is set and functional ?

1 Like

There's one main acme.sh cronjob which acme.sh install itself:

# crontab -l
7 0 * * * "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh" > /dev/null

That cronjob will call the acme.sh --install-cert for you, at the appropriate time.

I'm not sure, I don't think acme.sh has a dry-run sort of command. You might try setting a calendar reminder 1 week prior to the expiry of your certificate, and check that your mailserver is using the new certificate at that point.

1 Like

Cheers AZ, after getting the reaload process set right i made a cron for each but there wasnt an existing cronjob :frowning:

2 Likes