From 3aae7b50d9eff7925da01561d5ecd1983d141d95 Mon Sep 17 00:00:00 2001 From: thespad Date: Mon, 6 Jan 2025 16:54:53 +0000 Subject: [PATCH] Migrate existing renewal confs with old paths --- root/migrations/02-swag-old-certbot-paths | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 root/migrations/02-swag-old-certbot-paths diff --git a/root/migrations/02-swag-old-certbot-paths b/root/migrations/02-swag-old-certbot-paths new file mode 100755 index 0000000..c5a594d --- /dev/null +++ b/root/migrations/02-swag-old-certbot-paths @@ -0,0 +1,7 @@ +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +# Migrate existing confs with old paths from /etc/letsencrypt to /config/etc/letsencrypt +if [[ ! -f "/config/etc/letsencrypt/02-swag-old-certbot-paths" ]] && ls /config/etc/letsencrypt/renewal/*.conf >/dev/null 2>&1; then + sed -i 's| /etc/letsencrypt|/config/etc/letsencrypt|' /config/etc/letsencrypt/renewal/*.conf && touch /config/etc/letsencrypt/02-swag-old-certbot-paths +fi