Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cytopia/letsencrypt-watch
[sh] certwatch cron implementation for letsencrypt certificates
https://github.com/cytopia/letsencrypt-watch
certificate letsencrypt letsencrypt-watch nginx
Last synced: 12 days ago
JSON representation
[sh] certwatch cron implementation for letsencrypt certificates
- Host: GitHub
- URL: https://github.com/cytopia/letsencrypt-watch
- Owner: cytopia
- Created: 2016-03-30T11:01:03.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-03-31T08:47:55.000Z (almost 9 years ago)
- Last Synced: 2024-12-27T06:41:23.945Z (15 days ago)
- Topics: certificate, letsencrypt, letsencrypt-watch, nginx
- Language: Shell
- Homepage: https://www.everythingcli.org
- Size: 12.7 KB
- Stars: 10
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# letsencrypt-watch
Independent [certwatch](http://linux.die.net/man/1/certwatch) cron script for [letsencrypt](https://letsencrypt.org) certificates.
---
See also: **[nginx-certwatch](https://github.com/cytopia/nginx-certwatch)**
---
This was mainly built as I am using [nginx](http://nginx.org/) and the normal `/etc/cron.daily/certwatch` script is not picking up the SSL certificates in my vhosts as it relies on [apache](apache.org) and quits if it is not found:
```shell
test -x /etc/httpd/modules/libmodnss.so || return 0
# and
test -r /etc/httpd/conf/httpd.conf || return 0
```Add this shell script to your crontab (or copy it to `/etc/cron.daily/`) to be notified via email when your certificates reach expiry.
The default behavior (without arguments) is to notify the root user, once the certificates will expire in 30 days or less.## Usage
All command line arguments are optional and if not specified, the default values are used.
```shell
$ letsencrypt-watch [--period=30] [[email protected]] [--path=/etc/letsencryt]--period=XX specify period in days to check for (Default: 30)
--email=root specify email to send notifications if period expires (Default: root)
--path=/etc/path specify letsencrypt base path (Default: /etc/letsencrypt)```
## Cronjob
Put the following example in your cron daily and replace the email with your own.
```shell
@daily /path/to/letsencrypt-watch [email protected]
```
or
```shell
0 0 * * * /path/to/letsencrypt-watch [email protected]
```## Note
* 100% POSIX compatible
* No [bashism](http://mywiki.wooledge.org/Bashism)