Versions Compared

Key

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

...

  • Store this script under `/bin/certbot_renewal/update_OpenHIM.sh`. 
  • Ensure it is executable by running  `sudo chmod +x /bin/certbot_renewal/update_OpenHIM.sh`.
Code Block
languagebash
titleupdate_OpenHIM.sh
In Progress

...

  • Store this script under `/bin/certbot_renewal/renewal_cronjob.sh.
  • Ensure it is executable by running  `sudo chmod +x /bin/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/cert.test2.ohie.org certonly --renew-hook "/bin/certbot_renewal/update_OpenHIM.sh" -n 
		# -n ensures a noninteractive session 
		# --renew-hook command only fires if a certificate is renewed
exit 0

...

  • Run `crontab -e`.  Add the following contents:
Code Block
languagebash
titleSetting the Cronjobchrontab -e contents
0 1,13 * * * /bin/certbot_renewal/renewal_cronjob.sh