#!/bin/bash set -e PROJECT_DIR="$(cd "$(dirname "$0")/.." && pwd)" cd "$PROJECT_DIR" echo "[$(date)] Checking and renewing SSL certificates..." docker compose run --rm certbot renew --webroot --webroot-path=/var/www/certbot docker compose exec nginx nginx -s reload || docker compose restart nginx echo "[$(date)] Certificate check finished."