Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Store this script under `/binetc/certbot_renewal/update_OpenHIM.sh`. 
  • Ensure it is executable by running  `chmod +x /binetc/certbot_renewal/update_OpenHIM.sh`.

...

  • Store this script under `/binetc/certbot_renewal/renewal_cronjob.sh.
  • Ensure it is executable by running  `chmod +x /binetc/certbot_renewal/renewal_cronjob.sh`.
Code Block
languagebash
titlerenewal_cronjob.sh
#!/bin/bash
## navigate to directory with ./certbot-auto
cd /path/to/certbot-auto
## check if the certificate is expiring soon and renew it if needed
sudo ./certbot-auto --config /etc/letsencrypt/configs/ls.datim4u.org.conf certonly --renew-hook "/binetc/certbot_renewal/update_OpenHIM.sh" -n 
		# -n ensures a noninteractive session 
		# --renew-hook command only fires if a certificate is renewed
exit 0

...

Code Block
languagebash
titlechrontab -e contents
0 1,13 * * * /binetc/certbot_renewal/renewal_cronjob.sh