mirror of
https://github.com/outbackdingo/labca.git
synced 2026-01-27 10:19:34 +00:00
15 lines
361 B
Bash
Executable File
15 lines
361 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
RENEW=30
|
|
TODAY=`date '+%Y_%m_%d'`
|
|
|
|
echo $TODAY >> /etc/nginx/ssl/cron.log
|
|
|
|
if ! expires=`openssl x509 -checkend $[ 86400 * $RENEW ] -noout -in /etc/nginx/ssl/labca_cert.pem`; then
|
|
echo " renewing!" >> /etc/nginx/ssl/cron.log
|
|
cp /etc/nginx/ssl/labca_cert.pem /etc/nginx/ssl/labca_cert_$TODAY.pem
|
|
~labca/labca/renew
|
|
fi
|