mirror of
https://github.com/outbackdingo/labca.git
synced 2026-01-27 18:19:33 +00:00
17 lines
426 B
Bash
Executable File
17 lines
426 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
RENEW=30
|
|
TODAY=`date '+%Y_%m_%d'`
|
|
|
|
echo "Running cron-$(basename $0) for ${TODAY}..."
|
|
|
|
if ! expires=`openssl x509 -checkend $[ 86400 * $RENEW ] -noout -in /etc/nginx/ssl/labca_cert.pem`; then
|
|
echo " renewing!"
|
|
cp -p /etc/nginx/ssl/labca_cert.pem /etc/nginx/ssl/labca_cert_$TODAY.pem
|
|
/opt/labca/renew
|
|
fi
|
|
|
|
/opt/labca/bin/labca-gui -config /opt/labca/data/config.json -renewcrl $RENEW
|