Files
labca/checkrenew
Arjan H 0ed9d8eac2 Build and use local docker images for docker-only setup (#41)
For now, the images are still built on the target machine for testing,
in the end they need to be built in a GitHub action.
2023-04-15 09:19:17 +02:00

15 lines
347 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