From fdec15fa6b8375d7399843933a3d75a6d8879c74 Mon Sep 17 00:00:00 2001 From: Dennis Marttinen Date: Fri, 7 Mar 2025 18:04:38 +0200 Subject: [PATCH] fix: properly handle expiring DDNS records Some DDNS providers, such as dy.fi, have a 7-day expiration for DDNS records if they're not updated, even if the associated IP hasn't changed. ddclient isn't smart enough to figure that out, so remove its cache every 5 days to force it to perform an update and keep the record alive. Signed-off-by: Dennis Marttinen --- work/ddclient.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/work/ddclient.yaml b/work/ddclient.yaml index 885b4a9..305916a 100644 --- a/work/ddclient.yaml +++ b/work/ddclient.yaml @@ -20,6 +20,17 @@ spec: - -xec - | apk --no-cache add ddclient + + # Some DDNS providers, such as dy.fi, have a 7-day expiration for DDNS records if they're not updated, + # even if the associated IP hasn't changed. ddclient isn't smart enough to figure that out, so remove + # its cache every 5 days to force it to perform an update and keep the record alive. + remove_cache() { + while sleep 5d; do + rm -f /var/cache/ddclient/ddclient.cache + done + } + + remove_cache & exec ddclient -foreground -file /config/ddclient.conf securityContext: privileged: false